I have the following code fragment in a PHP ASP webpage:
Code: Select all
function getFromForm($p) {
$x = $HTTP_POST_VARS[$p]; //or $_POST[$p] or $HTTP_GET_VARS[$p] or $_GET[$p],
if (is_null($x)) return "<none>";
if ($x == "") return "<none>";
return $x;
}
$x = getFromForm("clientid");
echo "|".$x."|";this is run the first time I enter my web page - it always prints "||", which means the function is returning an empty string or a null string. On the first run of the page, the POST variable 'clientid' does not yet exist until I submit the form which is at the bottom of this page.
So why is the function not returning "<none>" as it is designed to do?
Leo
Pllease help - I'm getting seriously desperate (I've wasted a whole worksday on this problem