I was wandering how you would go about sending a form to different pages.
If there is an error in the form, stay on the page, showing an error and if there is no error go onto another page
here is my code
<form id = "form" action = "./?page=markandfeedback" method = "post">
<br>
Mark for:
<INPUT id="txtChar" onkeypress="return isNumberKey(event)" type="text" name="txtChar" value="Enter Student Number" style="min-width:165px;">
<input type="button" value = 'Continue' onclick="validate()">
<?
$studID = $_POST['txtChar'];
$module2 = $_SESSION['module'];
$ex = $_POST['exer'];
$studerr = array();
$sql = 'SELECT * FROM `student`, `modules` WHERE `studentID` = '.$studID.' AND `moduleCode` = '.$_SESSION['module'];
$result = mysql_query ($sql);
echo $_SESSION['module'];
if(isset($studID)){
if($result == null){
$studerr[] = "No Student with that ";
print_r($studerr);
}
$_SESSION['student'] = $studID;
}
echo' <SCRIPT TYPE="text/javascript" LANGUAGE="javascript">
function validate() {
if('.$result.' == null)
{
return false
}
else
{
return true;
}
}
</script>';
?>
</form>
cheers
Very briefly (without knowing other details):