login  Naam:   Wachtwoord: 
Registreer je!
 Forum

stuk code wordt overgeslagen

Offline Voronwe - 07/11/2008 16:23
Avatar van VoronweLid Als een formulier is ingevoerd worden er flink wat controles uitgevoerd,
alle controles worden netjes uitgevoerd maar als het script bij een stuk code uitkomt slaat hij het naar het schijnt over.
Dit is de code:
  1. if(empty($_POST['voorNaam'])) {
  2. header('Location: hand.php?e=4');
  3. }
  4. elseif(empty($_POST['achterNaam'])){
  5. header('Location: hand.php?e=5');
  6. }
  7. elseif(empty($_POST['emailAdres'])){
  8. header('Location: hand.php?e=6');
  9. }
  10. elseif(empty($_POST['emailHerhaal'])){
  11. header('Location: hand.php?e=7');
  12. }
  13. elseif($_POST['emailHerhaal'] != $_POST['emailAdres']){
  14. header('Location: hand.php?e=8');
  15. }
  16. elseif(empty($_POST['bo']) && $_POST['toneel'] && empty($_POST['dans']) && empty($_POST['koor'])){
  17. header('Location: hand.php?e=9');
  18. }
  19. elseif(isset($_POST['bo'])){
  20. if(empty($_POST['orkestPart'])){
  21. header('Location: hand.php?e=10');
  22. }
  23. if(isset($_POST['dans'])){
  24. header('Location: hand.php?e=11');
  25. }
  26. if(isset($_POST['toneel'])){
  27. header('Location: hand.php?e=11');
  28. }
  29. if(isset($_POST['koor'])){
  30. header('Location: hand.php?e=11');
  31. }
  32. if(empty($_POST['instrument'])){
  33. header('Location: hand.php?e=12');
  34. }
  35. } else {
  36. $qSelect = querySelect('email','aanmeldingen','','WHERE email="'.$_POST['emailAdres'].'"','email');
  37. if($qSelect == TRUE) {
  38. header('Location: hand.php?e=3');
  39. } else { // dit stuk slaat hij over
  40. $qInsert = queryInsert('aanmeldingen','voornaam, infix, achternaam, email, klas, toneel, dans, koor, bo, participation, instrument, aangenomen',
  41. '"'.$_POST['voorNaam'].'","'.$_POST['infix'].'","'.$_POST['achterNaam'].'","'.$_POST['emailAdres'].'","'.$_POST['klas'].'",
  42. "'.$_POST['toneel'].'","'.$_POST['dans'].'","'.$_POST['koor'].'","'.$_POST['bo'].'","'.$_POST['orkestPart'].'","'.$_POST['instrument'].'",0');
  43. if($qInsert == FALSE){
  44. header('Location: hand.php?e=2');
  45. } else {
  46. header('Location: hand.php?i=1');
  47. }
  48. } // tot hier
  49. }


ik hoop dat jullie een fout of iets anders kunnen vinden, want ik ben echt radeloos.
alvast zeer bedankt!

2 antwoorden

Gesponsorde links
Offline Giant - 07/11/2008 16:26
Avatar van Giant PHP beginner
  1. if($qSelect == FALSE) {
  2. header('Location: hand.php?e=3');
  3. } else { // dit stuk slaat hij over

en zo dan?
Offline Voronwe - 07/11/2008 16:31
Avatar van Voronwe Lid in de variabele wordt gekeken of het opgegeven email adres al bestaat nu verander je alleen maar dat als de uitkomst FALSE geeft dat je dan een error bericht krijgt terwijl dat juist moet als het emailadres wel bestaat.
of zie ik het nu verkeerd? 
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.183s