FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


$_SERVER[?]





moejoe
Hi,

Is there a $_SERVER function that will retrieve the Entire link, including varibles.

for example,
if the URL is /search.php?search=thing

Is there a way the $_SERVER will capture the entire string?

Thanks.
Star Wars Fanatic
Well in that case (/search.php?search=thing) you can find it in the $_GET array, to access the "search"" variable, just use this:

Code:
$_GET['search']
powers1983
moejoe wrote:
Hi,

Is there a $_SERVER function that will retrieve the Entire link, including varibles.

for example,
if the URL is /search.php?search=thing

Is there a way the $_SERVER will capture the entire string?

Thanks.


There are a few that do it depending on what you need to capture:

Go to this address http://www.frihost.com/phpinfo.php?tsk=5&another=thingy and at the bottom of the page is the PHP variables and just look at the _SERVER ones for the exact information you need.

eg.
Code:

_SERVER["REQUEST_URI"]

gives
Code:

/phpinfo.php?tsk=5&another=thingy

which is what I think you ask for.

Obviosuly tsk and another are totally made up but they are easy ways to see what the _SERVER variables are.

Hope that helps.

David.
moejoe
BINGO DAVID.

Thats the one.

Thanks a BUNCH!
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.