You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Index.php 914B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. session_start();
  3. ?>
  4. <!DOCTYPE html>
  5. <html>
  6. <head><title>Ganzenbord</title></head>
  7. <body>
  8. <?php
  9. if (!isset($_SESSION["PlayerOne"]) or (!$_SESSION["PlayerOne"])){
  10. $_SESSION["PlayerOne"] = true;
  11. echo "<h1>Player One</h1>";
  12. } else {
  13. $_SESSION["PlayerOne"] = false;
  14. echo "<h1>Player Two</h1>";
  15. }
  16. if(!isset($_SESSION["PosPOne"])){
  17. $_SESSION["PosPOne"] = 0;
  18. }
  19. if(!isset($_SESSION["PosPTwo"])){
  20. $_SESSION["PosPTwo"] = 0;
  21. }
  22. if(!isset($_SESSION["SkipPOne"])){
  23. $_SESSION["SkipPOne"] = 0;
  24. }
  25. if(!isset($_SESSION["SkipPTwo"])){
  26. $_SESSION["SkipPTwo"] = 0;
  27. }
  28. $PlayerOne = $_SESSION["PlayerOne"];
  29. $PosPOne = $_SESSION["PosPOne"];
  30. $PosPTwo = $_SESSION["PosPTwo"];
  31. $SkipPOne = $_SESSION["SkipPOne"];
  32. $SkipPTwo = $_SESSION["SkipPTwo"];
  33. $dobbelsteen = rand(1,6);
  34. echo "<hr/>Je hebt " . $dobbelsteen . " gesmeten."
  35. if(PlayerOne)
  36. ?>
  37. </body>
  38. </html>