Passage de variables dans l'URL impossible ??? [PHP] - PHP - Programmation
Marsh Posté le 09-01-2003 à 19:33:04
External variables are no longer registered in the global scope by default. In other words, as of PHP 4.2.0 the PHP directive register_globals is off by default in php.ini. The preferred method of accessing these values is via the autoglobal arrays mentioned above. Older scripts, books, and tutorials may rely on this directive being on. If on, for example, one could use $id from the URL http://www.example.com/foo.php?id=42. Whether on or off, $_GET['id'] is available.
http://www.php.net/manual/en/tutorial.oldcode.php
http://www.php.net/manual/en/langu [...] efined.php
Marsh Posté le 09-01-2003 à 20:02:45
beleg a écrit : External variables are no longer registered in the global scope by default. In other words, as of PHP 4.2.0 the PHP directive register_globals is off by default in php.ini. The preferred method of accessing these values is via the autoglobal arrays mentioned above. Older scripts, books, and tutorials may rely on this directive being on. If on, for example, one could use $id from the URL http://www.example.com/foo.php?id=42. Whether on or off, $_GET['id'] is available. |
Thanks a lot
Marsh Posté le 09-01-2003 à 19:27:20
Bonsoir,
Voilà je débute en php et j'ai un petit problème avec le passage de variables dans l'URL.
J'ai le code suivant :
Si je tape dans Netscape :
http://localhost/~johndoe/test.php?toto=5
J'ai juste "toto vaut" qui s'affiche dans la fenêtre (au lieu de "toto vaut 5" ).
Je m'y prends mal ?
Merci d'avance,
Un phpéteux qui a du mal.