|
|
|
|
|
0)
{
$no = mysql_errno();
$msg = mysql_error();
echo " [".$no."] - ".$msg." ";
// HERE we must add a Test of error code.
// If connection doesn't work -> Message
echo "This Server isn't ready to work";
exit;
}
// unset system that records visitor only once by course for statistics
unset($alreadyHome);
unset($dbname);
//////////////////////////////////////////////////////
$result = mysql_query("SELECT id FROM register");
if ($myrow = mysql_fetch_array($result)) {
do {
$i=$i+1;
$last_id=$myrow["id"];
} while ($myrow = mysql_fetch_array($result));
} else {
$last_id = 1;
}
$last_id = $last_id + 1;
$rname1 = QuerySafeString($_POST['rname']);
$prof1 = QuerySafeString($_POST['prof']);
$rocc1 = QuerySafeString($_POST['rocc']);
$raddress1 = QuerySafeString($_POST['raddress']);
$city1 = QuerySafeString($_POST['city']);
$tel1 = intval($_POST['tel']);
$wtel1 = intval($_POST['wtel']);
$mtel1 = QuerySafeString($_POST['mtel']);
$fax1 = intval($_POST['fax']);
$remail1 = QuerySafeString($_POST['remail']);
$arr1 = QuerySafeString($_POST['arr']);
$adate1 = QuerySafeString($_POST['adate']);
$dep1 = QuerySafeString($_POST['dep']);
$ddate1 = QuerySafeString($_POST['ddate']);
$inscr_user=mysql_query("INSERT INTO register(id, name, occupation, address, Email, prof, city, tel, wtel, mtel, fax, arr, dep, adate, ddate, country) VALUES ($last_id, '$rname', '$rocc', '$raddress', '$remail', '$prof', '$city', '$tel', '$wtel', '$mtel', '$fax', '$arr', '$dep', '$adate', '$ddate', '$country')");
?>
}?>
}?>
| | |