Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][HTML]Shoutbox tylko zalogowany
luzak124
post
Post #1





Grupa: Zarejestrowani
Postów: 170
Pomógł: 1
Dołączył: 3.09.2006
Skąd: Białystok

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


znalazłem coś takiego:



Index.html

  1. <iframe src="show.php" width="150" height="250" frameborder="0"></iframe>
  2. <form name="shoutForm" method="POST" action="addShout.php">
  3. <input type="hidden" name="user" value="<!-- USER LOGIN -->" size="15">
  4. <input type="text" name="shout" size="15"><br>
  5. <input type="submit" value="Wy&para;lij">
  6. </form>


addShout.php :

  1. <?php
  2.  
  3.  $fp = fopen("shouts.txt","a");
  4.  fwrite($fp,$_POST['user'].":".$_POST['shout']."\n");
  5.  fclose($fp);
  6.  $shoutbox_page = "index.php";
  7.  header("Location: $shoutbox_page");
  8.  
  9. ?>


show.php:

  1. <html>
  2. <head>
  3. <meta http-equiv="refresh" content="60">
  4. </head>
  5. <body style="font-family:Verdana; font-size:11px; padding:5px;" leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
  6.  
  7. <?php 
  8.  
  9. $fp = fopen("shouts.txt","r");
  10. while(($shout = fgetcsv($fp,1000,":")) !== FALSE) {
  11.  
  12.  echo "<b>".$shout[0]." : </b>".$shout[1]."<br>";
  13. }
  14.  
  15. fclose($fp);
  16.  
  17. ?>
  18.  
  19. </body>
  20. </html>



ale mam taki problem shoutbox jest wyświetlany za pomocą pliku index.HTML i jak przerobić ten skrypt żeby wyświetlał się tylko dla zalogowanych dokładnie przycisk Wyślij wraz z polem do wpisania tekstu ale skrypt do wyświetlanie shotboxa index.html ma to być plik HTML a wiec nie mogę tam dać skryptu PHP
POMOCY

Ten post edytował luzak124 8.06.2008, 21:28:52
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: 22.12.2025 - 21:41