Can anyone tell me why I keep getting a plain white screen after submitting my form? Here's the code (some of them are generated by dreamweaver and I don't think I have enough time to learn how to do it manually because I need this running in a few hours)
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "formform")) {
//already reserved--------------------------------------------------------
$query=sprintf("SELECT * FROM tblsetting");
$settings = mysql_query($query);
while($row=mysql_fetch_array($settings)){
$maxdays = $row['MaxBooks'];
$fmaxbooks = $row['fMaxBooks'];
}
////check currently borrowed books----------------------------------------
$Status="pending";
mysql_connect("localhost", "root","");
mysql_select_db("dblib");
$result2=sprintf("SELECT * FROM tblbook_borrow WHERE BorrowerID=%s AND Status=%s",
GetSQLValueString($_SESSION['MM_Username'], "text"), GetSQLValueString($Status, "text"));
$result1 = mysql_query($result2);
$totalRows_result1 = mysql_num_rows($result1) or die(mysql_error());
while($row= mysql_fetch_array($result1)){
if ($totalRows_result1 = $maxdays){
die("You've reached the maximum amount of books per person. <br /> Unable to reserve selected book.");
}
}
////check current reservations--------------------------------------------
$Status="Pending";
//mysql_connect("localhost", "root","");
//mysql_select_db("dblib");
$result2=sprintf("SELECT * FROM tblreservation WHERE rStudentNo=%s AND rStatus=%s",
GetSQLValueString($_SESSION['MM_Username'], "text"), GetSQLValueString($Status, "text"));
$result1 = mysql_query($result2);
$totalRows_result1 = mysql_num_rows($result1) or die(mysql_error());
if ($totalRows_result1 = 1){
die("You've reached the maximum amount of books reserved per person. <br /> Unable to reserve selected book.");
}
////check remaining copies------------------------------------------------
$Status = "Available";
mysql_connect("localhost", "root","");
mysql_select_db("dblib");
$result2=sprintf("SELECT * FROM tblaccession WHERE aAN=%s",
GetSQLValueString($_POST['txtAN'], "text"));
$result1 = mysql_query($result2);
while($row= mysql_fetch_array($result1)){
$CallNo = $result1['aCN'];
}
$result2=sprintf("SELECT * FROM tblaccession WHERE aCN=%s AND aStatus=%s",
GetSQLValueString($CallNo, "text"), GetSQLValueString($Status, "text"));
$result1 = mysql_query($result2);
$totalRows_result1 = mysql_num_rows($result1) or die(mysql_error());
if ($totalRows_result1 <= 1){
die("There is only one available copy left of this book. Unable to reserve selected book.");
}
////check date------------------------------------------------------------
$dayz = "Sunday";
$date = $_POST['hiddenField'] ;
$weekday = date('l', strtotime($date));
if($weekday=="Sunday"){
die("You cannot reserve a book on Sunday.");
}
////check holiday---------------------------------------------------------
do{
$searchdate = $row_Recordset3['hMonth'] . "/" . $row_Recordset3['hDay'];
$datenow = date("m/d/Y");
$pos = strrpos($datenow, $searchdate);
if ($pos === false) {
}
else {
die("You cannot reserve on a holiday");
}
} while ($row_Recordset3 = mysql_fetch_assoc($Recordset3));
//--------------------------------------------------------already reserved
$dates = date("m/d/y");
$times = "HH:MM";
$status = "Pending";
$insertSQL = sprintf("INSERT INTO tblreserve (bCN, rStudentNo, rDate, rTime, rStatus) VALUES (%s, %s, %s, %s, %s)",
GetSQLValueString($_POST['txtAN'], "text"),
GetSQLValueString($_POST['txtSN'], "text"),
GetSQLValueString($_POST['hiddenField'], "text"),
GetSQLValueString($times, "text"),
GetSQLValueString($status, "text"));
$txtANS = $_POST['txtAN'];
$updatequery="update tblaccession set aStatus='Pending' where aAN='$txtANS'";
mysql_select_db($database_mysqlcon, $mysqlcon);
$Result1 = mysql_query($insertSQL, $mysqlcon) or die(mysql_error());
$Result2 = mysql_query($updatequery, $mysqlcon) or die(mysql_error());
$insertGoTo = "step4.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}