PDA

View Full Version : Next/Previous link doesn't work


jianneng
07-19-2003, 08:13 AM
I have been running PHP 4.3.2 and MySQL 4.0.13 on Apache 1.3.27. All the while everything is fine, i.e. all my PHP testings and projects work perfectly.

However, recently when I created a book list page involving MySQL, because there are 200 books, so I coded the page such that each only displays 20 books. Therefore, there is a row that looks like this: 1 2 3 4 5... Next . So if you click 2, 3, or Next for instance, the page should display the next 20 records and so on.

Now, this seems weird, no matter how I click the number (or next), it just stays there, i.e. no display of the next 20 records at all. I have verified that my code is correct and that it also works on another PC running the same PHP+MySQL combination.

I thought this might be due to my php.ini, but after checking both PC's php.ini, nothing seems to be different. Well...something might be wrong, any idea about this? Thanks.

Lim.

raf
07-19-2003, 09:35 AM
You're right : there is possible something wrong.:D
Without seeing the code, we can't say anything more precise. (though some of us have psychic powers ...)

jianneng
07-19-2003, 10:00 AM
My eyes must be tired...

Checking again...and there is one difference in the php.ini of both PCs. I turned on the register_global in one and the other is not...so it seems my code will only work if register_global = On.

Too bad, I am practicing "insecure" coding...

mrjamin
07-20-2003, 06:50 PM
Originally posted by jianneng
My eyes must be tired...

Checking again...and there is one difference in the php.ini of both PCs. I turned on the register_global in one and the other is not...so it seems my code will only work if register_global = On.

Too bad, I am practicing "insecure" coding...

work with register_globals off; i made the switch about 6 months ago and my code has improved massively. It doesn't take a lot to adapt your coding!

ReadMe.txt
07-20-2003, 08:42 PM
I work locally with register_globals turned off, but the live version of my site has it turned on, which leads to a few problems when i use the same named variables in different superglobals.

You've been warned, watch out for that.