Quickly Run Any PHP Code Through A Form

15th October 2008

NOTE: This bit of code is potentially very dangerous and should NOT be uploaded to your web host. I only use this function on my localhost to quickly check that a snippet of code works.

If you want to quickly run some PHP code, and don't want to have to go through creating a file just to see the outcome of a simple calculation is then this snippet might be of some use to you.

Writing Function Code To Be More Readable

Last month I started writing functions in a particular way, which has made my life as a programmer much easier on more than one occasion. No matter how many comments or verbose parameter names you put in you can end up writing code that you will get lost in. The reason is simple. Lets say you had a function that took in a couple of parameters.

philipnorton42 Wed, 10/01/2008 - 08:30
Turn Off Analytics In Preview Mode With Wordpress

The preview mode in Wordpress exists to allow you to see how a post will look before you publish it to your site. This is an important feature if you have lots of readers as once your click that publish button your post will be live and your RSS feed will be pinged out to lots of different services. Previewing a post can avoid embarrassing spelling or formatting errors before the post goes live.

philipnorton42 Tue, 06/03/2008 - 08:45

Obfusticating PHP Code

4th May 2008

You will sometimes want to make sure that your code is a better hidden from the end user. For example, you might want to make sure that your database password files are completely hidden from prying eyes so that even if your web server is hacked your database server isn't also compromised.

Take the following code, which prints out "Hello world".


29th March 2008

W3Schools is one of the best online tutorial sites available, but in addition to that, the site is completely free. When I can't remember how a particular bit of syntax goes I can be pretty much certain that I will find it on this site. There are thousands of examples, explanations, quizzes and reference charts available and they don't bog you down in too much detail. The examples on the site tell you exactly what you need to know about the subject so that you can copy the code and get on with the task at hand.