NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
FAQ: I don't see parameters defined in URL, what's wrong ?
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
FAQ: I don't see parameters defined in URL, what's wrong ?

You probably forgot that when register_globals setting is off php does not add neither HTTP/GET nor HTTP/POST parameters to the GLOBAL scope. So if you run
Code:
myscript.php?myvar1=myval1&myvar2=myval2
you won't see neither $myvar1 nor $myvar2. If the setting is on the variables will be added automatically and you will see them with their proper values. But the setting is off by default.
On the other hand, it does not mean that you only have to set register_globals = on. Setting should be kept off and php community adviced to keep it off because of security reasons. To access the parameters you have to use superglobal arrays such as $_GET[] and $_POST[], for example
$_GET['myvar1'].
See http://www.php.net/register_globals for further details
View user's profileFind all posts by dmitriSend private messageVisit poster's website
FAQ: I don't see parameters defined in URL, what's wrong ?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic