Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] problem z ciachem :-)
mefjiu
post
Post #1





Grupa: Zarejestrowani
Postów: 313
Pomógł: 5
Dołączył: 22.03.2005

Ostrzeżenie: (0%)
-----


Witam,
chcę zablokować komentowanie artykułów 2 raz przez cookie zrobiłem coś takiego

  1. <?php
  2. if($_POST['author'] && $_POST['comment'])
  3. {
  4. setcookie("comentscokke", "1", time()+3600*3);
  5. if($comentscokke!="1")
  6. {
  7. $author = $_POST['author'];
  8. $comment = $_POST['comment'];
  9. $date = $_POST['date'];
  10.  
  11.  
  12. $author = htmlspecialchars($author);
  13. $comment = htmlspecialchars($comment);
  14.  
  15.  
  16. $comment = str_replace("n", '<br>', $comment);
  17.  
  18. global $date_format;
  19.  
  20. $date = gmdate($date_format);
  21.  
  22. $author = addslashes($author);
  23. $comment = addslashes($comment);
  24.  
  25. mysql_query("INSERT $mysql_comments_table (author, comment, date, post)
  26. VALUES ('$author', '$comment', '$date', '$post')");
  27.  
  28. $sava = '?' . $_SERVER['QUERY_STRING'];
  29. }
  30. else
  31. {
  32. display('error.php');
  33. }
  34.  
  35. header("Location: $sava");
  36. }
  37. ?>




i poprostu nadzwyczajnej to nie działa nie dało żadnego efektu ani żadnego błędu czy coś pomieszałem ?

proszę o pomoc z góry dziękuję.
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 12:25