Retreiving data with register_globals=off

My code was working fine until I upgraded to a newer PHP version, now I'm having major problems.

I have an index page, which takes a var like this: ""

I used to use this simple code:


to extract the page number, but this no longer works, so can someone please tell me what I should be using.

I know I can turn on register_globals but i dont want to...

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You don't need to turn on register_globals, but you do need to refer to your variable differently.  Try using this instead


I hope this helps :)
rjdownAuthor Commented:
Thanks for quick reply but still nothing...

I made a new file, test.php:

echo $page;

now if i go to this using test.php?page=23 i still get a blank page? :'(
try this, I don't think I explained myself terribly well before:

$page = $GET['page'];
echo $page;

If you don't understand what the above code does, post back and I'll explain more clearly

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rjdownAuthor Commented:
Oops, my bad.

I had a look through the php manual and found that it should in fact be $_GET. Horrah, my code works again :D

Thanks Lorna :D

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.