hi guys,
as i previously posted I have a php code that i made to use generically to submit comments posted on certain pages... for some reason when i try post to the script it comes up blank... doesn't process or anything and i cant figure this out... can someone point me in the right direction? thanks in advance
here is my form code:
here is my php script:
as i previously posted I have a php code that i made to use generically to submit comments posted on certain pages... for some reason when i try post to the script it comes up blank... doesn't process or anything and i cant figure this out... can someone point me in the right direction? thanks in advance
here is my form code:
Code:
<form method="POST" action="tstatusDB.php" >
<div align="center">
<input type="text" name="commentC" id="commentC" class="style6" value="whats on your mind?" size="20" onclick="this.value=''"/>
<input type="hidden" name="userName" id="userName" value="<?php print $userName;?>"/>
<input type="hidden" name="userAV" id="userAV"value="<?php print $userAV;?>"/>
<input type="hidden" name="commentID" id="commentID"value="<?php print $commentID;?>"/>
<input type="hidden" name="firstName" id="firstName" value="<?php print $firstName;?>"/>
<input type="hidden" name="lastName" id="lastName" value="<?php print $lastName;?>"/>
<input type="hidden" name="dateAdded" id="dateAdded" value="<?php print $dateAdded;?>"/>
<input type="hidden" name="formLocation" id="formLocation" value="tstatusUpdate"/>
<input type="submit" name="submit" value="submit" />
</div>
</form>
Code:
<? error_reporting(E_ALL);
include ("admin-dbcon.php");
$comment= $_POST['commentC'];
$userName= $_POST['userName'];
$userAV= $_POST['userAV'];
$commentID= $_POST['commentID'];
$firstName= $_POST['firstName'];
$lastName= $_POST['lastName'];
$dateAdded= $_POST['dateAdded'];
$formLocation= $_POST['formLocation'];
mysql_connect($hostname,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$sql = "SELECT * FROM statusUpdates WHERE commentID = '{$commentID}'";
$res = mysql_query( $sql ) or die( mysql_error );
if ( mysql_num_rows( $res ) > 0 ){
$result = mysql_query("SELECT * FROM lastComment WHERE commentID = '{$commentID}'");
$rowA = mysql_fetch_array( $result );
$i=$rowA['lastDigit'];
$i= $i+1;
$lastDigit= $i;
$queryA="INSERT INTO statusUpdates (userName,userAV,firstName,lastName,commentID,comment,dateAdded,comOrder)
VALUES ('".$userName."','".$userAV."','".$firstName."','".$lastName."','".$commentID."','".$comment."','".$dateAdded."','".$i++."')";
}
else {
$i=1;
$queryA="INSERT INTO statusUpdates (userName,userAV,firstName,lastName,commentID,comment,dateAdded,comOrder)
VALUES ('".$userName."','".$userAV."','".$firstName."','".$lastName."','".$commentID."','".$comment."','".$dateAdded."','".$i++."')";
}
$resultA=mysql_query($queryA) or die("Error in query:".mysql_error());
//if ($result)
//echo mysql_affected_rows()." row inserted into the database effectively.";
$sqlB = "SELECT * FROM lastComment WHERE commentID = '{$commentID}'";
$resB = mysql_query( $sqlB ) or die( mysql_error );
if ( mysql_num_rows( $resB ) > 0 ){
$i=$lastDigit;
$queryB="UPDATE lastComment SET
lastDigit='{$i}'
WHERE commentID= '{$commentID}'";
}
else {
$i=1;
$queryB="INSERT lastComment (commentID,lastDigit)
VALUES(
'$commentID',
'$i')";
}
$resultB=mysql_query($queryB) or die("Error in query:".mysql_error());
//if ($result)
//echo mysql_affected_rows()." row inserted into the database effectively.";
mysql_close();
}
echo $comment;
echo $userName;
echo $userAV;
echo $commentID;
echo $firstName=;
echo $lastName;
echo $dateAdded;
echo $formLocation;
?>
Comment