Forum Moderators: coopster

Message Too Old, No Replies

PHP5 doesn't extract variables from URL?

         

partha

10:43 pm on Mar 6, 2005 (gmt 0)

10+ Year Member



I have a bunch of pages I wrote for PHP4 where I pass a variable to the script through the URL, for example:

www.mysite.com/myscript.php?car=blue

and then the script would have the variable $car = "blue"

But now that I upgraded to PHP5, it just ignores the variables I pass in the URL. Is there a way to still do this in PHP5?

SeanW

10:48 pm on Mar 6, 2005 (gmt 0)

10+ Year Member



Check register_globals in php.ini... This isn't a PHP5 thing specifically (if it's what I'm thinking), it's a config issue. You should be able to access the variable with $_GET['car']

Sean

lasko

1:24 pm on Mar 7, 2005 (gmt 0)

10+ Year Member



its not a php5 thing but php5 has GLOBALS turned off by default for security reasons.

use $_GET['var'] when using the url