Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- Can't get empty $ GET


RammsteinNicCage - 11:54 pm on Aug 23, 2012 (gmt 0)


I'm having trouble getting some code to work properly. Here's an example of my code:

$a = $_GET['a'];
$b = $_GET['b'];
$c = $_GET['c'];
$d = $_GET['d'];
$e = $_GET['e'];

if (empty ($e) { echo "e is empty"; }


If I type in example.com/file.php?a=1&b=2&c=3&d=4&e= the echo is executed. I've tried doing this on different variations (empty, !empty, isset, !isset, etc) and cannot manage to get the echo to not execute. I did a vars dump and for the last variable, it said something like string(0) ""

Ideally, I'd like to test to see if each variable is empty, but I figured that'd be easy once I figure out how to get one of them to work....

Can someone please let me know what I am doing wrong and if there is a better way to do it? Even if there is a better way, I would like to know what am I missing when trying to do it this way.... Thanks for the help!


Thread source:: http://www.webmasterworld.com/php/4487813.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com