Blog
register_globals = off
2:25 PM   Wednesday
December 26, 2007

It appears that my music and contact pages have been broken for at least a few months now, as they rely on some old-school PHP that has been deemed kinda unsafe. I was unaware until my friend Ben told me my crap wasn’t working. It’s fixed now, so once again all my music is available and y’all can get in touch with me. I’m sharing the solution in case some other poor fool needs this information, unlikely as that may be.

Most servers nowadays automatically turn off register_globals in php.ini, and for good reason… leaving them on is really pretty hazardous. However, for something like my music page (which just needs a couple simple variables in and out), there’s no harm in using global variables from the URL string. To grab those values and make them available for use even though my server has register_globals disabled, all I had to do was add extract($_GET); to the top of the file. For the contact page, since that uses a form, I had to use extract($_POST); for obvious reasons. Yay.

Leave a Comment

You must be logged in to post a comment.