Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [php/mysql] Ksiega + Token
Forum PHP.pl > Forum > PHP
zaba12
Proszę o pomoc z wpisaniem do tego kodu tokena

bo ja próbowałem ale nic nie wychodziło mi sad.gif

  1. <?php
  2.  
  3. function ksiega()
  4. { global $lan;
  5. $query = "SELECT * FROM ksiega ORDER by id DESC";
  6. $result = mysql_query ($query);
  7. $ile=1;
  8. while ($row = mysql_fetch_array($result)) {
  9. $id = $row['id'];
  10. $text = $row['text'];
  11. $dodal = $row['dodal'];
  12. $email = $row['email'];
  13. $gg = $row['gg'];
  14. $www = $row['www'];
  15. $ip = $row['ip'];
  16. if($www<>'' AND $www<>'http://') $www = '<a href="'.$www.'" target="_blank">WWW</a>'; else $www = 'Brak';
  17. if($email<>'') $email = '<a href="mailto:'.$email.'">E-mail</a>'; else $email = 'Brak';
  18. if($gg<>'') $gg = '<a href="gg:'.$gg.'"><img src="http://www.gadu-gadu.pl/users/status.asp?id='.$gg.'&styl=1" border="0"></a>'; else $gg = 'Brak';
  19. $ip =substr($ip, 0, 11);
  20. echo "<table width='100%' cellpadding='0' cellspacing='1' class='tbl-border'>
  21. <tr>
  22. <td colspan='6' class='forum-caption'><b>".$lan['guestbook']." - Wpis ".$ile."</b></td>
  23. </tr>
  24. <tr>
  25. <td colspan='6' class='tbl1'>".$text."</td>
  26.  
  27. </tr>
  28. <tr>
  29. <td width='20%' class='tbl2'><b>".$lan['guestbook_author'].":</b> ".$dodal."</td>
  30. <td width='20%' class='tbl2'><b>E-mail:</b> ".$email."</td>
  31. <td width='20%' class='tbl1'><b>WWW:</b> ".$www."</td>
  32. <td width='25%' class='tbl1'><b>Ip:</b> ".$ip."XX</td>
  33. <td width='65%' class='tbl2'><b>GG:</b> ".$gg."</td>
  34. </tr>
  35. </table>
  36. <div align='center'><img src='theme/".$GLOBALS[theme]."/images/blank.gif' alt='' height='15' width='1'></div>";
  37. $ile++;
  38.  }
  39. }
  40.  
  41. function add_ksiega()
  42. { global $lan; 
  43. echo '
  44. <form name="ksiega" action="ksiega.php" method="POST" class="text">
  45. <table width="100%" align="center">
  46. <tr><td>'.$lan['guestbook_email'].':</td><td><input type="text" name="email" class="textbox" style="width:250px"/></td></tr>
  47. <tr><td>'.$lan['guestbook_gg'].':</td><td><input type="text" name="gg" class="textbox" style="width:250px"/></td></tr>
  48. <tr><td>'.$lan['guestbook_homepage'].':</td><td><input type="text" name="www" class="textbox" style="width:250px"/></td></tr>
  49. <tr><td>'.$lan['guestbook_text'].':</td><td><textarea name="text" rows="5" cols="25" class="textbox" style="width:250px"></textarea></td></tr>
  50. <tr><td>'.$lan['guestbook_author'].':</td><td><input type="text" name="dodal" class="textbox" style="width:250px"/></td></tr>
  51. <tr><td></td><td><INPUT type="hidden" name="cmd" value="dodaj"><input type="submit" class="button" value="'.$lan['guestbook_add'].'" />
  52.  <input type="reset" class="button" value="'.$lan['guestbook_clean'].'" /></td></tr></table>
  53. </form>';
  54.  
  55. }
  56.  
  57. function dodaj() {
  58.  
  59. global $text, $dodal, $email, $gg, $www, $REMOTE_ADDR, $lan,$token;
  60. $dodal = htmlspecialchars($dodal);
  61. $text = htmlspecialchars($text);
  62. $email = htmlspecialchars($email);
  63. if (!$email OR !$dodal OR !$text) {
  64.  echo $lan['guestbook_add_e'];
  65. } else {
  66. $query = "INSERT INTO ksiega VALUES(NULL, '$text', '$dodal', '$email', '$gg', '$www', '$REMOTE_ADDR')";
  67. $result = mysql_query($query);
  68.  
  69. header("Location: ksiega.php");
  70. }
  71. }
  72.  
  73. ?>
ciapek888
Wywaliłeś cały kod i piszesz, że coś nie tak i czego oczekujesz?
opisz swój problem to może się ktoś zainteresuje...
zaba12
Potrzebuje dopisac do tego kodu token jak sam próbuje to nic nie wychodzi sad.gif
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.