PDA

View Full Version : PHP Browser variable


Markpyro
02-03-2006, 12:05 PM
Many forum scripts have this feature, where there is one file that calls all the threads on the forum, showthread.php, but uses a function at the end such as "?t=12345" to show the thread you want. I want to duplicate this feature, but im not sure how it works. Does anyone have any sample script I could look at?

Thanks,
MP

edit: for example,
a link like "http://pyrom.net/phptest.php?f=4"
and I want to echo $f. What would the script look like?

Markpyro
02-03-2006, 7:59 PM
I figured out how to do this- one way is using $_GET, it apparently worked for some people but not for me. The way I solved it was using "$_REQUEST".

URL
http://blah.com/phptest.php?u=4

Code in .php file

<?php

echo $_REQUEST[u];

?>