Joined: 11 Apr 2010 |
Posts: 90 |
Location: Prague, Czech Republic |
|
 |
Posted: Fri Nov 05, 2010 10:43 am |
|
 |
 |
 |
 |
$_GET["dataname"] and $_GET['dataname'] are the same, they just use different type of quotes. However they should both work. I can think of only a few situations, when the variable would be empty.
1) You unset the variable using unset($_GET['dataname']) earlier in the script or overwrite it with NULL value (or empty string, etc.)
2) You have register_globals = on (PHP setting) and
a) you overwrite it by $dataname variable earlier in the script
b) it is overwritten by other variable from $_POST, or $_COOKIE
3) You have an internal redirection in your .htaccess file that strips the parameters
4) You have an the same redirection as in 3) but directly in .htconf of you Apache server or IIS equivalent of this
I can think of no other situation (save corrupted PHP) how this could happen otherwise. If possible I suggest you to use echo ini_get('register_globals') to check 2) and see if they are on. Then I would suggest to use var_dump($_GET) to see if your 'dataname' exists, is empty string, NULL, or otherwise. If it exists but is empty, it means it has been overwritten by empty value (NULL). If it does not exist, it means that it ether has been unset or it has never been registered, which would point me to 3) or 4). Together with this and verification of your code before using the variable you should be able to pinpoint the problem.
|
|