I need to check if a variable has a value. This works great, but when it doesn't have a value I get this error.
---------- code --------------------
Notice: Undefined index: id in c:\inetpub\wwwroot\php\index.php on line 13
---------- // code --------------------
Should I define the variable before using it, if so how is that done.
What else can I do about this. I use this code to check the variable
---------- code --------------------
if ($REQUEST["id"] != "") {
$session_id = $REQUEST["id"];
} else {
$session_id = "";
}
---------- // code --------------------