Unable to detect error in code please help me out t on
<?php require_once('Connections/book.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "comming")) {
if($_POST['coding'] == 19){
$insertSQL = sprintf("INSERT INTO bcomments (id, bid, commentin, fname, mail) VALUES (1, %s, %s, %s, %s)",
GetSQLValueString($_POST['id'], "int"),
GetSQLValueString($_POST['bid'], "int"),
GetSQLValueString($_POST['comments'], "text"),
GetSQLValueString($_POST['fname'], "text"),
GetSQLValueString($_POST['mail'], "text"));
mysql_select_db($database_book, $book);
$Result1 = mysql_query($insertSQL, $book) or die(mysql_error());
$insertGoTo = "books/".$_POST['url'];
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}else{
$insertGoTo = "books/".$_POST['url']."/error";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
}
$colname_authordetails = "-1";
if (isset($_GET['q'])) {
$colname_authordetails = $_GET['q'];
}
mysql_select_db($database_book, $book);
$query_authordetails = sprintf("SELECT * FROM book WHERE url = %s", GetSQLValueString($colname_authordetails, "text"));
$authordetails = mysql_query($query_authordetails, $book) or die(mysql_error());
$row_authordetails = mysql_fetch_assoc($authordetails);
$totalRows_authordetails = mysql_num_rows($authordetails);
$colname_commenting = "-1";
if (isset($row_authordetails['id'])) {
$colname_commenting = $row_authordetails['id'];
}
mysql_select_db($borders_db, $book);
$query_commenting = sprintf("SELECT * FROM bcomments WHERE id = %s ORDER BY id DESC", GetSQLValueString($colname_commenting, "int"));
$commenting = mysql_query($query_commenting, $book) or die(mysql_error());
$row_commenting = mysql_fetch_assoc($commenting);
$totalRows_commenting = mysql_num_rows($commenting);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-103795307-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-103795307-1');
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<meta name="description" content="Review of <?php echo $row_africanpublishedbooks['title']; ?> by Olatoun Williams" />
<title>Borders Literature Online | Review of <?php echo $row_africanpublishedbooks['title']; ?> by Olatoun Williams</title>
<link href="imaging/favicon.ico" rel="shortcut icon" />
<base href="http://<?php echo $_SERVER['HTTP_HOST']; ?>/" />
<link href="Scripting/normalize.css" rel="stylesheet" type="text/css" media="all" />
<link href="Scripting/getdevice.css" rel="stylesheet" type="text/css" media="all" />
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryValidationTextarea.css" rel="stylesheet" type="text/css" />
<link href="jQuery/css/style.css" rel="stylesheet" type="text/css" />
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<script src="SpryAssets/SpryValidationTextarea.js" type="text/javascript"></script>
<script type="text/javascript">var switchTo5x=true;</script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">stLight.options({publisher: "09a46005-f45b-400f-9230-7a1c97d221c2", doNotHash: false, doNotCopy: false, hashAddressBar: false});</script>
<style>
#commentss {
padding-top: 20px;
border-top-width: 1px;
border-top-style: solid;
border-top-color: #CCC;
margin-bottom: 30px;
}
#dcomment {
margin-bottom: 15px;
border-bottom-width: 1px;
border-bottom-style: dotted;
border-bottom-color: #CCC;
}
#dcomment span {
display: block;
margin-bottom: 5px;
font-weight: bold;
}
#tit{
line-height:24px;
}
</style>
</head>
<body>
<div id="topdiv">
<div class="wrapper">
<a href="index.php"><img name="" src="imaging/border-logo.png" width="215" height="84" alt="" /></a>
</div>
</div>
<div id="nav">
<div class="wrapper">
<div id="navbar">
<ul>
<li style="margin-left:0px;"><a href="/">Home</a></li>
<li><a href="about">About Us</a></li>
<li><a href="Book_Reviews_and_Podcasts">Book Reviews & Podcast</a></li>
<li><a href="Book_Trade_Interviews">Book Trade Interviews</a></li>
<li><a href="Africanist_and_Global">Africanist & Global</a></li>
<li><a href="Independent_Comment_About_Borders">Comment About Borders</a></li>
<li><a href="contact">Contact Us</a></li>
<li><a href="links">Links</a></li>
<li><a href="faq">Faq</a></li>
</ul>
<div class="clr"></div>
</div>
</div>
</div>
<div class="wrapper">
<div style="background-color:#FFF; margin-top:2%;"">
<div id="scon">
<h3><?php echo $row_authordetails['title']; ?></h3>
<div id="navin">
<a href="/">Home / </a><a href="Book_Reviews_and_Podcasts">Book Reviews & Podcast </a><span><?php echo $row_africanpublishedbooks['title']; ?></span>
</ul>
<div class="clr"></div>
</div>
<span style="display:block; padding:10px; font-size:16px; margin-bottom:25px; background-color:#E7E7E7"><strong>By </strong><a href="authors/<?php echo "".$row_authordetails['author']; ?>"><?php echo $row_authordetails['name']; ?></a> | <strong>Reviewed by:</strong> <?php echo $row_authordetails['reviewed']; ?> | <span class='st_facebook' displayText='Facebook'></span>
<span class='st_twitter' displayText='Tweet'></span>
<span class='st_linkedin' displayText='LinkedIn'></span>
<span class='st_googleplus' displayText='Google +'></span>
<span class='st_email' displayText='Email'></span></span></span>
<div style="font-size:16px; line-height:23px;"><img name="" src="uploads/<?php echo $row_authordetails['img']; ?>" alt="" style="float:left; margin-right:20px; padding:1px; border:solid 1px #999" /><?php echo $row_authordetails['details']; ?>
<div class="clr"></div>
<div style="margin-top:20px; border-top:solid 1px #CCC; padding-top:2px">
<div id="commentss">
<span class="sfont"><?php echo $totalRows_commenting; ?> Comment(s) </span>
<div class="uling">
<?php
if($totalRows_commenting == 0){
echo "No Comments";
}else{
do { ?>
<div id="dcomment">
<span>Posted by <?php echo $row_commenting['fname']; ?> | <?php $ddate = strtotime($row_commenting['adate']);
echo date("d.F.Y G:i:s", $ddate); ?></span>
<?php echo $row_commenting['commentin']; ?>
</div>
<?php } while ($row_commenting = mysql_fetch_assoc($commenting)); } ?>
</div>
</div>
<div id="addcomment">
<h3 class="font1">Add A Comment</h3>
<div>
<form id="comming" name="comming" method="POST" action="<?php echo $editFormAction; ?>">
<table width="100%" cellpadding="10" cellspacing="0">
<tr>
<td colspan="2" align="center" style="color:#900"><?php if(isset($_GET['err'])){ echo "Please Fill in all fields and make sure the secret code is correct"; } ?></td>
</tr>
<tr>
<td width="36%"><strong>Preferred Display Name:</strong></td>
<td width="64%">
<span id="sprytextfield1">
<input name="fname" type="text" class="txt" id="fname" />
<span class="textfieldRequiredMsg">*</span></span>
</td>
</tr>
<tr>
<td><strong>Email Address:</strong></td>
<td><span id="sprytextfield2">
<label for="mail"></label>
<input name="mail" type="text" class="txt" id="mail" />
<span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">Invalid email.</span></span></td>
</tr>
<tr>
<td valign="top"><strong>Your Comment:</strong></td>
<td><span id="sprytextarea1">
<label for="comments"></label>
<textarea name="comments" cols="45" rows="5" class="txt" id="comments"></textarea>
<span class="textareaRequiredMsg">*</span></span></td>
</tr>
<tr>
<td valign="top">Please add up this figures.</td>
<td><img name="" src="imaging/barcode.jpg" width="150" height="40" alt="" /><br />
<span id="sprytextfield3">
<label for="coding"></label>
<input type="text" name="coding" id="coding" />
<span class="textfieldRequiredMsg">*</span></span></td>
</tr>
<tr>
<td><input name="id" type="hidden" value="<?php echo $row_authordetails['id']; ?>" />
<input type="hidden" name="urls" id="" value="<?php echo $row_authordetails['urls']; ?>" /></td>
<td><input name="button" type="submit" class="btn" id="button" value="Submit" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="comming" />
</form>
</div>
</div>
</div>
</div>Discussão (1)
Carregando comentários...