Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sudden problem with passing URL variables

Status
Not open for further replies.

dbaseboy

Programmer
Apr 24, 2002
48
0
0
GB
Hi,

I run a number of sites which are all on the same host/ server, these sites have been running fine for months until last week when all of those that use php/mySQL have hit a problem.

Basically when you are passing variables via the URL it is returning a mySQL error saying "Cant jump to row 0". I checked the code and reuploaded the original files in case there'd been some corruption but to no avail.

I have raised it with the hosts who have said its a script problem but I cant see how thats possible, to be working for months then suddenly just stop.

To debug this I created a new page based on the receiving page and hard coded the variable that was being passed via the URL at the start of the code, this then worked so it clearly appears to be a problem passing the variables through the URL.

So that I have a chance of keeping my sanity (and clients) has anyone any ideas so I can point the hosts in the right direction? I get the feeling they just want to pawn the problem off onto me by saying its the code.
 
sleipner,

Cheers, I checked that and it was the problem, mailed the hosts to find they had turned the register_globals off. They've set up my htaccess file accordingly now so its working but I could do with some resource to read for making my code compliant, do you know of anywhere I can read up on it (done a google search but its not straight forward reading!).

Is it a simple case of putting a few lines of additional code into each of the pages that use it?
 
Making register_globals default to "off" was a decision the PHP developers made around PHP version 4.2. They have outlined their reasons in an appendix to the PHP online manual:
Although I suppose you could just turn on register_globals for your scripts, I recommend against it. I recommend that you edit your code so that it references the superglobals $_GET, $_POST, $_COOKIE, etc. You're going to have more secure code that is better self-documented.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top