Problem passing vars

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Formula
Forum Newbie
Posts: 6
Joined: Wed Mar 22, 2006 5:03 am

Problem passing vars

Post by Formula »

Hi,

I do hope it is the right room to ask...
I had to move one of my sites to a new server.
On the new server I can't pass variables using post or get methods.

I am using this method to get the vars:
while (list($name, $value) = each($POST)) {
${$name} = $value;
}

it doesn't working anymore.

Should I need to change something on the php.ini?

Thanks,
Assaf
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

underscore
Formula
Forum Newbie
Posts: 6
Joined: Wed Mar 22, 2006 5:03 am

Post by Formula »

sorry I am using _$POST and it doens't work...
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

Nope - it sure wouldn't!
Formula
Forum Newbie
Posts: 6
Joined: Wed Mar 22, 2006 5:03 am

Post by Formula »

why?
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

What you are trying to do is a bad idea for security reasons, it means it is possible for POST to overwrite previously declared values. So if you are going to do this do it before you declare any variables in your script and use the proper function for doing such things: extract().
Post Reply