Well $_GET[] should always have quotation marks between the brackets and numbers/letters/characters between the quotation marks. So $_GET[] on its own isn't a valid command. You need something like $_GET['a'] or $_GET['myvariable'] and if it does not exist in the url bar then it will return a string with 0 letters 0 numbers and 0 characters. So basically a $_GET statement which has letters between the brackets and quotation marks but those letters/variable does not exist in the url bar will return the below string if you remove the quotation marks:
"" - as you can see there is nothing between those quotation marks so you will just receive a blank string if it does not exist in the url bar.
So just a reminder, you always need something between those brackets (more than just quotation marks).
Edit:
I just saw more of what you are asking for and to check if there is nothing there i prefer to use the preg replace function just like follows:
$urlvars=preg_replace('/(.*)?(.*)/i',$2,$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
if ($urlvars='')
{
//code in here
}
The preg replace should be something along those lines.
Last edited by cwarn23; Sep 26th, 2008 at 7:24 am. Reason: Added info
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
Offline 3,004 posts
since Sep 2007