Forum Moderators: coopster

Message Too Old, No Replies

url variables are not working

         

willis1480

9:55 pm on Nov 17, 2004 (gmt 0)

10+ Year Member



has something changed in the newest versions of php and passing variables via the url. I have a page that no longer holds the info passed from the url. Do I have to access this variable a special way now?

Salsa

10:14 pm on Nov 17, 2004 (gmt 0)

10+ Year Member



In newer versions of PHP, register_gobals is turned off by default in your php.ini file.

With register_globals off, to access variables from the query string of your URL, you need to:

$variable_name = $_GET['variable_name'];

From forms with method='post', you can access variables like:

$variable_name = $_POST['variable_name'];

It's good security to have register_globals off, but if you want to turn them on to make your current scripts work until you make the modifications, open your php.ini file and search for "register_globals". Then change the line to:

register_globals = on

Assuming you're running Apache, you'll then have to restart Apache for the change to take effect.

I hope this helps.

willis1480

3:29 am on Nov 18, 2004 (gmt 0)

10+ Year Member



yeah, I was fairly sure that was the issue. I just never use the $_GET and couldnt find it in php site. I was trying to do $GET. Oh well, problem solved and thanks very much for the help. I dont admin the server, so no change of .ini file and not recompile.