Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include('conn.php');
- if(isset($_POST['add'])){
- $ID_art=$_POST['IDart'];
- $com=$_POST['com'];
- echo $ID_art;
- /* if(!is_numeric($ID_art)){
- header("location:index.php");
- exit;
- }*/
- if(strlen($com)<5){
- echo 'Please, add a comment with more than 5 letters';
- exit;
- }
- $query="INSERT into comments values(null,'$com',now(), 1, $ID_art, 0)";
- $result=mysql_query($query);
- echo $query;
- echo $result;
- if ($result){
- echo 'Your comment has been added';
- header ("location: article.php?art=".$ID_art);
- } else {
- echo 'Sorry, an error ocurred';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement