jalaladdin Posted August 19, 2011 Share Posted August 19, 2011 I WROTE THIS CODE FOR COMMENT FORM WHEN I FILL OUT FORM AND I CLICK SEND ,THIS CODE DOESN'T WORK I DON'T KHNOW WHAT'S PROBLEM? if(!empty($_POST['name'] )&&!empty($_POST['email']) && !empty($_POST['comment'])&& !empty($_POST['user_code']) ){ $n = $_POST['name'];$e=$_POST['email'];$me=$_POST['comment'];$id =intval( $_POST['message_id']);if($id>0){if( mysql_num_rows( mysql_query( "SELECT `cid` FROM `idea`WHERE `comment` = '" . $_POST['comment'] . "' and `email` = '" . $_POST['email'] . "' LIMIT 1" ) )< 1 ) {//vojood nadare pas felan kar kon $idea=mysql_query("INSERT INTO idea (name,email,comment,cid,checked) VALUES('$n','$e','$me','$id','0') "); mysql_set_charset("utf8",$con); printf('<div class=" bg-blue "><script language="javascript" type="text/javascript">alert("ADMIN AFTER CHECK COMMENT HE DISPLAY IT.");</script></div>');}else{ //else shart aval //echo"error"; }}else {//echo'<div class=" send"><center>SEND COMMENT</center></div>';} } Link to comment Share on other sites More sharing options...
jalaladdin Posted August 19, 2011 Author Share Posted August 19, 2011 WHEN I INSERT POST IN HOME PAGE THIS CODE IS GOOD WORK BUT THIS CODE FOR LATEST POST DOESN'T WORK Link to comment Share on other sites More sharing options...
thescientist Posted August 19, 2011 Share Posted August 19, 2011 you don't have to use caps. we can read lowercase letters just as easily.is there some sort of DB connect script you are not showing us? It also doesn't appear that you are checking for errors. It would also be helpful if you could tell us what is happening, and what you expect to be happening. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.