Debugging code

I’ve been writing some new stuff today for a website, which involves the admin area, and an automated changing of the password from the default.

For ages it wouldn’t work. It wasn’t redirecting to the “change password” page when all the variables were saying it should be doing. I’ve been through every stage, getting the script to print out the variable values in an effort to find out what was going wrong, and why it wasn’t working. Twenty minutes of debug effort later, I’ve realised what it was.
PHP uses a simple command called Header to redirect to another page. The version I had read
  Header(Location : http://www.website.org.uk/adminarea/change_password.php);
when it should have read
  Header(Location: http://www.website.org.uk/adminarea/change_password.php);

Can you spot the difference?

Non-Geeky Version

I’m a fuckwit and on occasion can’t read code, and miss the fucking obvious.



Leave a Reply

Your email address will not be published. Required fields are marked *