
Ich hab ein kleines Problem mit diesem Formular,
Wenn ich das Formular erfolgreich ausgefüllt und abgesendet habe, kommt es zu einem doppel Posting dieser Zeile:
Email wurde erfolgreich Abgesendet
Sieht dann so aus:
Email wurde erfolgreich AbgesendetEmail wurde erfolgreich Abgesendet
Woran könnte es liegen?

Danke für die Antwort im Vorraus :-*
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | <?php /** * @author // Adrian Strub// Sniper * @copyright 2008 // Adrian Strub // Sniper * @support // www.goa4.go.funpic.de */ defined ( 'main' ) or die ( 'no direct access' ); $title = $allgAr [ 'title' ]. ' :: Bestellung' ; $hmenu = 'Bestellung' ; $design = new design ( $title , $hmenu ); $design ->header(); $formular = true; if (isset( $_POST [ 'submit' ])){ $anrede = $_POST [ 'anrede' ]; $vorname = $_POST [ 'vorname' ]; $nachname = $_POST [ 'nachname' ]; $tag = $_POST [ 'tag' ]; $monat = $_POST [ 'monat' ]; $jahr = $_POST [ 'jahr' ]; $tel = $_POST [ 'tel' ]; $email = $_POST [ 'email' ]; $bewerbung = $_POST [ 'bewerbung' ]; $auf = $_POST [ 'auf' ]; $sonstiges = $_POST [ 'sonstiges' ]; $fehler = "" ; if ( $anrede == "Bitte wählen" ) $fehler .= "<li>Ihre Anrede fehlt!" ; if ( empty ( $vorname )) $fehler .= "<li>Ihr Vorname fehlt!" ; if ( empty ( $nachname )) $fehler .= "<li>Ihr Nachname fehlt!" ; if ( empty ( $tag ) || empty ( $monat ) || empty ( $jahr )) $fehler .= "<li>Ihr Geburtsdatum fehlt!" ; if ( empty ( $tel ) || ! is_numeric ( $tel )) $fehler .= "<li>Ihre Telefon oder Handynummer fehlt oder ungültig ist!" ; if ( empty ( $email ) || ! strpos ( $email , "@" )) $fehler .= "<li>Ihre Email Adresse fehlt oder ungültig ist!" ; if ( empty ( $bewerbung )) $fehler .= "<li>Ihre Tätigkeit fehlt!" ; if ( empty ( $auf )) $fehler .= "<li>Die Stundenzeit fehlt!" ; if ( empty ( $sonstiges )) $fehler .= "<li>Ihre Referenzen fehlt!" ; if ( empty ( $fehler )){ $an = "Deine Email Adresse" ; $betreff = "Dein Betreff" ; $from = "From: $anrede $nachname<$email>" ; $text = "Anrede: $anrede\n" ; $text .= "Vorname: $vorname\n" ; $text .= "Nachname: $nachname\n" ; $text .= "Geburtsdatum: $tag.$monat.$jahr\n" ; $text .= "Telefon/Handynummer: $tel\n" ; $text .= "Email Adresse: $email\n" ; $text .= "Bewerbung als: $bewerbung\n" ; $text .= "Auf: $auf\n" ; $text .= "Sonstiges/Referenzen: \n$arbeit" ; mail( $an , $betreff , $text , $from ); $formular = false; echo "Email wurde erfolgreich Abgesendet" ; } else { echo "Email konnte nicht gesendet werden weil:" ; echo "<ul>$fehler</ul>" ; } } if ( $formular == false){ echo "Email wurde erfolgreich Abgesendet" ; echo "<br /><br />" ; echo "<a href=\"index.php\"><input type=\"button\" value=\"weiter\" /></a>" ; } if ( $formular == true){ ?> <form method= "post" action= "" > <table cellpadding= "2" cellspacing= "0" > <tr> <td colspan= "2" >Bitte alle Felder ausfüllen</td> </tr> <tr> <td>Anrede:</td> <td> <select name= "anrede" > <option label= "Bitte wählen" >Bitte wählen</option> <option label= "Herr" >Herr</option> <option label= "Frau" >Frau</option> </select> </td> </tr> <tr> <td>Vorname:</td> <td><input type= "text" name= "vorname" size= "30" maxlength= "20" value= "<?php echo $vorname; ?>" /></td> </tr> <tr> <td>Nachname:</td> <td><input type= "text" name= "nachname" size= "30" maxlength= "20" value= "<?php echo $nachname; ?>" /></td> </tr> <tr> <td>Geburtsdatum:</td> <td> <select name= "tag" > <option label= "" ></option> <?php for ( $t = 1; $t <= 31; $t ++){ echo "<option label=\"$t\">$t</option>" ; } ?> </select> <select name= "monat" > <option label= "" ></option> <?php for ( $m = 1; $m <= 12; $m ++){ echo "<option label=\"$m\">$m</option>" ; } ?> </select> <select name= "jahr" > <option label= "" ></option> <?php $d = date ( "Y" ); $ergebnis = $d - 100; $ergebnis2 = $d - 18; for ( $j = $ergebnis ; $j <= $ergebnis2 ; $j ++){ echo "<option label=\"$j\">$j</option>" ; } ?> </select> </td> </tr> <tr> <td>Telefon/Handynummer:</td> <td><input type= "text" name= "tel" size= "30" maxlength= "20" value= "<?php echo $tel; ?>" /></td> </tr> <tr> <td>Email Adresse:</td> <td><input type= "text" name= "email" size= "30" maxlength= "30" value= "<?php echo $email; ?>" /></td> </tr> <tr> <td valign= "top" >Bewerbung als:</td> <td> <input type= "radio" name= "bewerbung" value= "Servicekraft" /> Servicekraft<br /> <input type= "radio" name= "bewerbung" value= "Barkeeper" /> Barkeeper<br /> <input type= "radio" name= "bewerbung" value= "Koch" /> Koch<br /> <input type= "radio" name= "bewerbung" value= "Küchenhilfe" /> Küchenhilfe </td> </tr> <tr> <td colspan= "2" ><br /></td> </tr> <tr> <td valign= "top" >Auf:</td> <td> <input type= "radio" name= "auf" value= "Vollzeit" /> Vollzeit<br /> <input type= "radio" name= "auf" value= "Teilzeit" /> Teilzeit<br /> <input type= "radio" name= "auf" value= "400€" /> 400€ </td> </tr> <tr> <td colspan= "2" ><br /></td> </tr> <tr> <td>Sonstiges/Referenzen:</td> <td><textarea name= "sonstiges" cols= "15" rows= "6" ><?php echo $sonstiges ; ?></textarea></td> </tr> <tr> <td> </td> <td><input type= "submit" name= "submit" value= "Bewerben" /></td> </tr> </table> </form> <?php } $design ->footer(); function check_tag( $tag ){ return ; echo "<select name=\"tag\">" ; echo "<option label=\"\"></option>" ; for ( $t = 1; $t <= 31; $t ++){ echo "<option label=\"$t\">$t</option>" ; } echo "</select>" ; } ?> |