I am trying to write a function that will check for validation on a form i am not sure i have the function or the code writen correctly. As it does not work. Does anyone have an idea how i can do this with php. I am checking to see if the user checks the box before allowing him to go to the next page bellow is the code thanks for your help
this is on the page that contains the form
$update_profile->validate($t1, $t2);
if(validate == false)
{
echo "Please select type";
}
else
{
if($t1 != "")
{
echo $t1;
$_SESSION['divisionType'] = $_SESSION['coll'];
header("Location: "."register.php");
}
else
{
echo $t2;
$_SESSION['divisionType'] = $_SESSION['high'];
header("Location: "."register.php");
}
}
<form name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<table width="150" border="0" cellpadding="0" cellspacing="0" class="box" align="center">
<tr bgcolor="#CCCCCC">
<td>Collegiate Coach:</td>
<td align="center"> <input type="radio" name="collegiate" value="collegiate"></td>
</tr>
<tr>
<td>High School Coach:</td>
<td align="center"><input type="radio" name="highschool" value="highschool"></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="Submit" value="Next -->"></td>
</tr>
</table>
</form>
the funciton
function validate($t1, $t2s)
{
if($t1 == NULL && $t2 == NULL)
{
return false;
}
else
return true;
}