Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]"Skrypt komentarzy"
ReBeLs513
post
Post #1





Grupa: Zarejestrowani
Postów: 233
Pomógł: 0
Dołączył: 14.03.2010
Skąd: Dessau

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


Od dwóch godzin męczę się, aby ten skrypt:
  1. <?php
  2. if (isset($_POST['submit'])) {
  3. if (isset($_POST['message'])) {
  4. if (isset($_COOKIE['dodano'])) {
  5. echo "<font color=\"red\">Dodałeś(-aś) komentarz! Spróbuj ponownie za 10
  6.  
  7. sekund</font><br><br>";
  8. } else {
  9. $message = str_replace('www','*',$_POST['message']);
  10. $message = ereg_replace("rnrn", "n<P>", $message);
  11. $date=date("H:i d.m.Y");
  12. $message = "<font size=\"1\">&gt&gt&gt ".$date."</font>
  13.  
  14. <br><B>".$_POST['name']."</B><BR>".$message."<P>";
  15. $fp = fopen (basename($_SERVER['PHP_SELF']) . ".txt", "a");
  16. fwrite ($fp, $message);
  17. fclose ($fp);
  18. setcookie ("dodano", "{$_POST['name']}", time()+10);
  19. }
  20. }
  21. }
  22.  
  23. ?>
(formularz mam)
wyświetlał ostatnie wpisy na górze a nie na dole...

te linijki mam zmienić
  1. $message = str_replace('www','*',$_POST['message']);
  2. $message = ereg_replace("rnrn", "n<P>", $message);
?
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 24.08.2025 - 13:40