The code is sending for profile comment,I dont know what is wrong with my code because when i click the POSTCOMMENT button It just gives a blank Page,with no Error desplayed
or Any message.
And actualy the Datas are not sent.
<?php
//Connect to the database server
$dbcnx=@mysql_connect('localhost','root','650715');
if(!$dbcnx){
exit('<p>Unable to connect to the database</p>');
}
//select the joke database
if(!@mysql_select_db('register')){
exit('<p>Unable to locate the profile'.
'Database at the this time.</p>');
}
if(isset($_GET['id'])){
$userid=$_GET['id'];
$user=$_SESSION['user'];
if(isset($_POST['comment'])){
$comment=$_POST['comment'];
$sql="INSERT INTO profcomment SET
comment='$comment',
user='$userid',
sender='$user';
//commentdate=CURDATE()";
if(@mysql_query($sql)){
echo '<p>Your comment has been added.</p>';
}else{
echo '<p><font color=white>Error adding submitted comment:</font>';
mysql_error() .'</p>';
}
}
$result=@mysql_query("SELECT *FROM profcomment where user='$userid'");
$num=mysql_num_rows($result);
echo"<font color=red>There are $num comments </font><br>";
if(!$result){
exit('<p>Error perfoming query:' .
mysql_error() .'</p>');
}
//Diaplay the text of each profcomment in paragraph
while($row=mysql_fetch_array($result)){
$sender=$row['sender'];
$comment=$row['comment'];
$date=$row['commentdate'];
echo "<table width=280 height=5 align=center border=1 cellpadding=3 cellspacing=2 bordercolor=black bgcolor=creem>";
echo "<tr><td>
<p>$comment</p>
<p>posted by:<font color=blue>$sender</font> date:<font color=blue>$date</font></p></td></tr>";
echo "</table>";
}
}
?>
<table border=0 width=100 height=50 cellspacing=1 cellpadding=1 align=right>
<tr >
<td valign=top>
<form action=<?php echo$_SERVER['PHP_SELF'];?> method=POST >
<textarea name="comment" rows=2 cols=32>
</textarea></tr>
<tr><td align=right>
<input type="submit" name="submit" value="postcomment"/>
</form> </center>
</td>
</tr>
</table>
</td>
</TR>
</table>
I need your help Please!!!