Im creating a web form for user input into a database using PHP...
i have the form and have assigned:
$name = $_POST["name"];
im then trying to validate it using:
function CheckName($name)
{
if(isset($name))
{
if(!preg_match("/[^a-zA-Z\.\ ]+$/s",$name))
return TRUE;
else
return FALSE;
}
}
but i have the problem that the system thinks the variable $name is set, even when i load the page for the first time... or just press the submit button on the form without typing anything in it.
Im not sure whats going on, can anybody shed some light?
i have the form and have assigned:
$name = $_POST["name"];
im then trying to validate it using:
function CheckName($name)
{
if(isset($name))
{
if(!preg_match("/[^a-zA-Z\.\ ]+$/s",$name))
return TRUE;
else
return FALSE;
}
}
but i have the problem that the system thinks the variable $name is set, even when i load the page for the first time... or just press the submit button on the form without typing anything in it.
Im not sure whats going on, can anybody shed some light?