...

View Full Version : $_server



Crisp
01-23-2010, 08:00 PM
Hey,
Is there something where I can get the full file?
For example, the URL is: xx/xxx/xx/x.php
I want: /file.php?action=x&do=x
$_SERVER['REQUEST_URI'] works, but it leaves anything after & out.

Can you help me?
Thanks!

kbluhm
01-23-2010, 08:42 PM
$_SERVER also contains a key call QUERY_STRING:

$full_uri = $_SERVER['REQUEST_URI'];

if ( ! empty( $_SERVER['QUERY_STRING'] ) )
{
$full_uri .= '?' . $_SERVER['QUERY_STRING'];
}

echo $full_uri;

ninnypants
01-23-2010, 08:43 PM
you can use $_SERVER['QUERY_STRING'] to get everything after the ?

Crisp
01-23-2010, 08:45 PM
That works, but again it only gets ?action=X. I need it to also get anything after &.
EDIT: Never mind, it works!
thanks!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum