login  Naam:   Wachtwoord: 
Registreer je!
 Forum

Waar zit ze parse error?

Offline raintjah - 28/06/2005 16:44
Avatar van raintjahNieuw lid
  1. <table border=0 cellpadding=0 cellspacing=0 width=453>
  2. <tr><td width=500 background="images/titmain.jpg" height=30><table height=100%><tr><td width=10></td><td class="body" valign="bottom"><b>Add Achievement</b></td></tr></table></td></tr>
  3. <tr><td background="images/mainback.jpg">
  4. <?php
  5. include('connectdb.php');
  6. if(isset($_POST['submit'])) {
  7. $cat = $_POST['cat'];
  8. $ranking = $_POST['ranking'];
  9. $place = $_POST['place'];
  10. $game = $_POST['game'];
  11. $type = $_POST['type'];
  12. $query = "INSERT INTO achievements(cat, ranking, place, game, type) VALUES ('$cat', '$ranking', '$place', '$game', '$type')";
  13. mysql_query($query) or die(mysql_error());
  14. ?>
  15. <table class="body">
  16. <tr><td width=15></td><td class="body">
  17. Achievement has been added. Thank you.
  18. <?php
  19. }
  20. else {
  21. ?>
  22. <table class="body">
  23. <tr><td width=15></td><td class="body">
  24. <form action="index.php?page=addachievement" method="POST">
  25. Categorie:<br><select name="cat" class="body">
  26. <option value="Counterstrike">Counterstrike
  27. <option value="Other Games">Other Games
  28. </select><br />
  29. Ranking:<br><input type="text" name="ranking" class="body"><br>
  30. Place:<br><input type="text" name="place" class="body" value=""><br>
  31. Game:<br><input type="text" name="game" class="body"><br>
  32. Type:<br><input type="text" name="type" class="body"><br>
  33. <input type="submit" name="submit" value="Submit">
  34. </form>
  35. <?php
  36. }
  37. } else {
  38. print("ERROR: You are not permitted to do this!");
  39. }
  40. ?>
  41. </td><td width=25></td></tr>
  42. </table>
  43. </td></tr>
  44. <tr><td background="images/mainbottom.jpg" height=30>
  45. </td></tr>
  46. </table>



Parse error: parse error in c:\program files\easyphp1-8\www\ts\addachievement.php on line 37

6 antwoorden

Gesponsorde links
Offline nemesiskoen - 28/06/2005 16:45
Avatar van nemesiskoen Gouden medaille

PHP expert
  1. }
  2. } else {


daar

je sluit een else, en opent een andere else.
dit = onmogelijk
Offline cracker - 28/06/2005 16:47
Avatar van cracker Onbekend bij die eerste else moet je dan elseif gebruiken.
Offline raintjah - 28/06/2005 16:54
Avatar van raintjah Nieuw lid
Citaat:
bij die eerste else moet je dan elseif gebruiken.


Dat wil niet werken dan krijg ik parse error in line 20
Offline nemesiskoen - 28/06/2005 16:54 (laatste wijziging 28/06/2005 16:56)
Avatar van nemesiskoen Gouden medaille

PHP expert
omdat je met elseif een 'argument' moet meegeven.

dus bv.

  1. elseif( a == 2 ) {


wat ik denk is dat jij bovenaan een if bent vergeten.

Die er ongeveer als volgt zou uitzien

  1. <?php
  2. if( lidHeeftRechten() ) {
  3. //volledige code
  4. }
  5. else {
  6. echo "you are not...";
  7. }
  8. ?>
Offline raintjah - 28/06/2005 16:58
Avatar van raintjah Nieuw lid heb t 
thx all
Offline cracker - 28/06/2005 16:59
Avatar van cracker Onbekend
  1. <table border=0 cellpadding=0 cellspacing=0 width=453>
  2. <tr><td width=500 background="images/titmain.jpg" height=30><table height=100%><tr><td width=10></td><td class="body" valign="bottom"><b>Add Achievement</b></td></tr></table></td></tr>
  3. <tr><td background="images/mainback.jpg">
  4. <?php
  5. include('connectdb.php');
  6. if(rechten == "alle"){ //wijzig deze waarde
  7. if(isset($_POST['submit'])) {
  8. $cat = $_POST['cat'];
  9. $ranking = $_POST['ranking'];
  10. $place = $_POST['place'];
  11. $game = $_POST['game'];
  12. $type = $_POST['type'];
  13. $query = "INSERT INTO achievements(cat, ranking, place, game, type) VALUES ('$cat', '$ranking', '$place', '$game', '$type')";
  14. mysql_query($query) or die(mysql_error());
  15. ?>
  16. <table class="body">
  17. <tr><td width=15></td><td class="body">
  18. Achievement has been added. Thank you.
  19. <?php
  20. }
  21. }else {
  22. ?>
  23. <table class="body">
  24. <tr><td width=15></td><td class="body">
  25. <form action="index.php?page=addachievement" method="POST">
  26. Categorie:<br><select name="cat" class="body">
  27. <option value="Counterstrike">Counterstrike
  28. <option value="Other Games">Other Games
  29. </select><br />
  30. Ranking:<br><input type="text" name="ranking" class="body"><br>
  31. Place:<br><input type="text" name="place" class="body" value=""><br>
  32. Game:<br><input type="text" name="game" class="body"><br>
  33. Type:<br><input type="text" name="type" class="body"><br>
  34. <input type="submit" name="submit" value="Submit">
  35. </form>
  36. <?php
  37. }
  38. } else {
  39. print("ERROR: You are not permitted to do this!");
  40. }
  41. ?>
  42. </td><td width=25></td></tr>
  43. </table>
  44. </td></tr>
  45. <tr><td background="images/mainbottom.jpg" height=30>
  46. </td></tr>
  47. </table>
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2025 Sitemasters.be - Regels - Laadtijd: 0.334s