First steps with PHP

Published by at 8th June 2010 10:24 pm

I'm currently working on my very first website for anyone other than myself. It's a simple brochure-style website advertising a friend's chalet at a seaside resort, which she wants to be able to rent out, and includes a simple contact form so that people can get in touch to ask questions or make a booking enquiry. Now, at present Python is the only programming language I know at all well that's useful for server-side scripting, but I decided to have a bash at building it using PHP, since that's pretty well supported and there's loads of tutorials and resources for teaching PHP to newbies, as well as innumerable third-party scripts and libraries. Also, PHP's such a popular language that you can't really get away from it if you want to get into web development - I see loads of PHP jobs advertised but very few Python ones. So I figured it'll be useful to have picked up a little PHP.

I got the form working, and I've added reCAPTCHA support to it to help prevent spam. All in all the form is working well, and it didn't take a great deal of PHP knowledge to write the script. I'm already pretty confident that it's a language I can work with in future, possibly even on a professional basis. That said, I can already tell that I will never like working with PHP as much as I like working with Python - the syntax is far less elegant than that of Python, and the object-orientation looks and feels much more clumsy to me.

There's plenty of things I'd like to be able to do that require PHP, so I will be learning it thoroughly at some point, although I have no plans to do so immediately - I'm about to do my JavaScript Fundamentals exam later this month, and after that I've got to learn Perl, so it's not till I get that done that I'll be learning PHP properly. In particular, I'm really interested in Wordpress theme development - I want to build a theme of my own for this blog since that'll say more about my abilities than an off-the-shelf theme, and it also happens to be an increasingly marketable skill.