Advertisement
Guest User

Untitled

a guest
Apr 19th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. include('conn.php');
  2. if(isset($_POST['add'])){
  3. $ID_art=$_POST['IDart'];
  4. $com=$_POST['com'];
  5. echo $ID_art;
  6. /* if(!is_numeric($ID_art)){
  7. header("location:index.php");
  8. exit;
  9. }*/
  10. if(strlen($com)<5){
  11. echo 'Please, add a comment with more than 5 letters';
  12. exit;
  13. }
  14. $query="INSERT into comments values(null,'$com',now(), 1, $ID_art, 0)";
  15. $result=mysql_query($query);
  16. echo $query;
  17. echo $result;
  18. if ($result){
  19. echo 'Your comment has been added';
  20. header ("location: article.php?art=".$ID_art);
  21. } else {
  22. echo 'Sorry, an error ocurred';
  23. }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement