Thanks!
PHP Help
Moderator: General Moderators
-
Simon18711
- Forum Newbie
- Posts: 4
- Joined: Fri Feb 21, 2003 7:27 pm
PHP Help
Hello can any1 tell me wat the code is so i can make a link look like this?! http://yoursite.com/news.php?id=1 i want the ?id=1 onto the end of my page url! and to bring up the data from the DB! i hope u can help me
Thanks!
Thanks!
passing parameters this way is called GET-method.
In newer versions of php (see also: http://forums.devnetwork.net/viewtopic.php?t=511) the script can access those values via the superglobal array $_GET.
In your example it would be
see also:
http://www.php.net/manual/en/language.v ... ternal.php
http://www.php.net/manual/en/function.urlencode.php
http://www.php.net/manual/en/reserved.variables.php
http://www.php.net/manual/en/language.v ... .scope.php
In newer versions of php (see also: http://forums.devnetwork.net/viewtopic.php?t=511) the script can access those values via the superglobal array $_GET.
In your example it would be
Code: Select all
$_GET['id'] == '1' // --> TRUEsee also:
http://www.php.net/manual/en/language.v ... ternal.php
http://www.php.net/manual/en/function.urlencode.php
http://www.php.net/manual/en/reserved.variables.php
http://www.php.net/manual/en/language.v ... .scope.php
-
fractalvibes
- Forum Contributor
- Posts: 335
- Joined: Thu Sep 26, 2002 6:14 pm
- Location: Waco, Texas