PhP Undefined Variable?

  • Thread starter Thread starter Memphis
  • Start date Start date
M

Memphis

Guest
Hi,

This is my little bit of code that is causing the problem:

$validationOK=true;
if (trim($EmailFrom)=="") $validationOK=false;
if (trim($FirstName)=="") $validationOK=false;
if (trim($TelNo)=="") $validationOK=false;
if (!is_numeric($TelNo)) $validationOK=false;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";
exit;
}

It says these lines;

if (trim($EmailFrom)=="") $validationOK=false;
if (trim($FirstName)=="") $validationOK=false;
if (trim($TelNo)=="") $validationOK=false;
if (!is_numeric($TelNo)) $validationOK=false;

Have Undefined Variables.

How can I fix this? (No real php experience, so please dont get too technical :P)

Thanks :)
Hey thanks you guys,

That got rid of all the notices I had before!

Just one more thing though, I have this now:

Notice: Unexpected ";" in NAS42EMT\domains\f\***********.com\userzhtdocs\support.php on line 18

This is line 18:

$validationOK = (trim(isset($EmailFrom) == "") || (trim($FirstName) == "") || (trim($TelNo) == "") || (!is_numeric($TelNo)) ? 0 : 1;

I have tried taking the ; away but its not liking that very much :P
 
Back
Top