I have a site that I created some time ago that has been operating just fine until today. It seems that today, variables I am passing as post (in the URI) don't seem to be acknowledged by my script. Here is a sample URL:

http://www.somehost.com/edit_post.php?id=14

I used to be able to reference that as a variable everywhere in my page. For example, I could use this:

print $id;

As a quick debugging line to find out the value of that variable. That no longer works for me. Inside my script, I use a condititional like this:

if(!isset($id))
{
  print this;
}
else
{
  print that;
}

This conditional is completely broken now. Everything else is working fine -- my scripts can access a database just fine, and there are no other anomalies that I can see so far. Does anyone here know of perhaps a new version of PHP that may have been loaded to prevent the use of POST variables like this? Perhaps there was some server modification to prevent this? Any information would be greatly appreciated!

Could be something like register globals being turned off. You can manually reset it for your script if you want, look at php.net's page for more info.

Yep...looks like you're right. Looks like my server upgraded to version 4.3.11 and anything after 4.2 has register_globals turned off by default. Thanks for your help!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.