Page 1 of 1

[SOLVED] URL Question

Posted: Tue Jul 12, 2005 9:32 pm
by Sphen001
Hi guys,

I'm wondering if you could help me with this question. Basically, I'm looking to examine a URL and determine if there is a query string attached. Basically, I want to do this:

Code: Select all

<?php
if($query_string)
{
  $url = $_SERVER['PHP_SELF'] . '&foo=bar';
}
else
{
  $url = $_SERVER['PHP_SELF'] . '?foo=bar';
}
?>
Thanks for any and all help :D

Sphen001

Posted: Tue Jul 12, 2005 9:42 pm
by Burrito
$_SERVER['QUERY_STRING']

:D

Posted: Tue Jul 12, 2005 9:55 pm
by Sphen001
Thanks Burrito

That little tip triggered an idea. :D

Sphen001