login  Naam:   Wachtwoord: 
Registreer je!
 Forum

Script werkt niet

Offline blablabla - 26/09/2008 19:45
Avatar van blablablaNieuw lid Dit script:
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  5. <title>Spirit Harvest Talk</title>
  6. </head>
  7. <?php
  8. include("connect.php");
  9. if(isset($_GET['iTalk'])) {
  10. $iTalk = $_GET['iTalk'];
  11. $sql = "SELECT * FROM TalkTopics WHERE TopicName = '".$iTalk."' ";
  12. $result = mysql_query($sql)or die(mysql_error());;
  13. $rij = mysql_fetch_assoc($result);
  14. echo $rij['TopicName'];
  15. echo "<br /><br />";
  16. echo $rij['TopicContent'];
  17. echo "<br /><br />";
  18. ?>
  19. <a href="javascript:history.back(1)">back</a>
  20. <?php
  21. }
  22. else
  23. {
  24. $sql = 'SELECT * FROM TalkTopics';
  25. $result = mysql_query($sql)or die(mysql_error());;
  26. $count = mysql_num_rows($result);
  27. if($count < 20) {
  28. while($rij = mysql_fetch_assoc($result);
  29. echo "<a href=\"/talk.php?iTalk=" . $rij['TopicName'] . "\" />" . $rij['TopicName'] . "</a>";
  30. echo "<br />";
  31. echo $rij['TopicContent'];
  32. }
  33. }
  34. ?>
  35.  
  36.  
  37. <script type="text/javascript">
  38. function loguit()
  39. {
  40. r = confirm("Are you sure you want to log out?");
  41. if(r == true) {
  42. window.location="/talk.php?delsession";
  43. }
  44. }
  45. </script>
  46. <a href="#" onclick="loguit()">Log out</a>
  47. <?php
  48. if(isset($_GET['delsession'])) {
  49. echo "logged out";
  50. }
  51.  
  52. ?>
  53.  
  54. <body>
  55. </body>
  56. </html>

ik krijg geen errors, maar een leeg scherm.
wat is er fout aan dit script?

1 antwoord

Gesponsorde links
Offline Giant - 26/09/2008 20:17
Avatar van Giant PHP beginner

Die moeten HELEMAAL bovenaan de pagina,
en ooit van tabs of spaties gehoord?
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.326s