checkboxen einfügen

  • Hallo,


    jedes Jahr melde ich mich hier wieder. Nachdem letztes Jahr mit meinen Anmeldungen für ein Symposium alles gut geklappt hat, wollte ich
    an meiner Anmeldeseite dieses Jahre eigentlich nichts ändern bzw nur auf das neue Programm 2012 anpassen und
    ganz evtl. Übertragung der Daten in eine Datenbank...bin aber mit fwrite in eine Textdatei auch zurechtgekommen. War halt bisschen
    copy and paste bis ich das in Excel hatte.
    Allerdings kam die glorreiche Idee auf einen Workshop zu veranstalten, d.h es gibt 3 Workshops am morgen und genau die gleichen am Nachmittag.
    Jeder Teilnehmer nimmt morgens an einem und mittag an einem anderen Workshop teil, also pro Teilnehmer 2 Workshops.
    Brauche also irgendwie 3 Checkboxen, von denen 2 angeklickt sein müssen in meinem bestehenden Anmeldeformular.
    Bisher habe ich arrays immer irgendwie umschifft...gebe ich ja zu und wollte auch für 3 Checkboxen keine anlegen.
    Leider ist meine Hochphase bzw. Wissen aufgrund der Pause etwas reduziert worden und frage mal an,
    wie ich das am einfachsten lösen kann.


    Code
    1. <span class="syntaxdefault"><?php<br /><br /><br /><br /><br /><br /><br />echo </span><span class="syntaxstring">"<p><h2>Anzeige der Daten</h2></p>"</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">;<br /><br /><br /></span><span class="syntaxdefault"> echo </span><span class="syntaxstring">"<li>Vorname: "</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">  $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Vorname'</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault"> echo </span><span class="syntaxstring">"<li>Nachname: "</span><span class="syntaxkeyword">.</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Nachname'</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault"> echo </span><span class="syntaxstring">"<li>Strasse: "</span><span class="syntaxkeyword">.</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Strasse'</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault"> echo </span><span class="syntaxstring">"<li>Hausnummer: "</span><span class="syntaxkeyword">.</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Hausnummer'</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault"> echo </span><span class="syntaxstring">"<li>Postleitzahl: "</span><span class="syntaxkeyword">.</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'PLZ'</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault"> echo </span><span class="syntaxstring">"<li>Ort: "</span><span class="syntaxkeyword">.</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Ort'</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault"> echo </span><span class="syntaxstring">"<li>Vorwahl: "</span><span class="syntaxkeyword">.</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Vorwahl'</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault"> echo </span><span class="syntaxstring">"<li>Rufnummer: "</span><span class="syntaxkeyword">.</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Rufnummer'</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault">  echo </span><span class="syntaxstring">"<li>workshop: "</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">  $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'workshop'</span><span class="syntaxkeyword">];<br /><br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment">//echo "<li>Anrede: ".  $_POST['Anrede'];<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment">//echo "<li>Ermaessigung: ".  $_POST['Ermaessigung'];<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment">//echo "<li>ihmaehl: ". $_POST['ihmaehl'] ;<br />//----------------suchmuster ihmaehl-------------------------<br /><br /></span><span class="syntaxdefault">    $suchmuster </span><span class="syntaxkeyword">=</span><span class="syntaxdefault">  </span><span class="syntaxstring">"/^[-\w.]+@([A-z0-9][-A-z0-9]+\.)+[A-z]{2,4}$/"</span><span class="syntaxkeyword">;<br /><br /><br /><br /></span><span class="syntaxdefault"> </span><span class="syntaxcomment">//--------------------------htmlentitles-----------------------<br /><br /></span><span class="syntaxdefault"> foreach</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST as $Var</span><span class="syntaxkeyword">)<br />{<br /></span><span class="syntaxdefault">  $Var </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> htmlentities</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$Var</span><span class="syntaxkeyword">);<br />}<br /><br /></span><span class="syntaxdefault"> </span><span class="syntaxcomment">//--------------------------Datum und Uhrzeit<br /><br /></span><span class="syntaxdefault"> $datum </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> date </span><span class="syntaxkeyword">(</span><span class="syntaxstring">"d.m.y"</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault"> $uhrzeit </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> date </span><span class="syntaxkeyword">(</span><span class="syntaxstring">"H:i"</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault"> $zeitderanmeldung </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> $datum</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault"> $zeitderanmeldung </span><span class="syntaxkeyword">.=</span><span class="syntaxstring">"  "</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault"> $zeitderanmeldung </span><span class="syntaxkeyword">.=</span><span class="syntaxdefault">$uhrzeit</span><span class="syntaxkeyword">;<br /><br /></span><span class="syntaxcomment">//Spamschutz---------------------------------------------<br /><br /></span><span class="syntaxdefault">        if<br /><br />                 </span><span class="syntaxkeyword">(!empty(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'email'</span><span class="syntaxkeyword">]))<br /></span><span class="syntaxdefault">                </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                    echo </span><span class="syntaxstring">'Spam-Eintrag!'</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                    exit</span><span class="syntaxkeyword">();<br /></span><span class="syntaxdefault">                </span><span class="syntaxkeyword">}<br /><br /><br /></span><span class="syntaxdefault"> </span><span class="syntaxcomment">//Pruefen ob alles ausgefüllt ist-------------------------<br /><br /><br /></span><span class="syntaxdefault">    if</span><span class="syntaxkeyword">(<br /><br /></span><span class="syntaxdefault">                $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Vorname'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">""</span><span class="syntaxdefault"> or<br />                $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Nachname'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">""</span><span class="syntaxdefault"> or<br />                $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Strasse'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">""</span><span class="syntaxdefault"> or<br />                $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'PLZ'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">""</span><span class="syntaxdefault"> or<br />                </span><span class="syntaxkeyword">!</span><span class="syntaxdefault">preg_match</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"/^\d{5}$/"</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> trim</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'PLZ'</span><span class="syntaxkeyword">]))</span><span class="syntaxdefault"> or<br />                $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Hausnummer'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxstring">""</span><span class="syntaxdefault"> or<br />                $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Ort'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">""</span><span class="syntaxdefault"> or<br />                 $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Vorwahl'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxstring">""</span><span class="syntaxdefault"> or<br />                 $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'einverstanden'</span><span class="syntaxkeyword">]==</span><span class="syntaxstring">""</span><span class="syntaxdefault">   or<br />                 </span><span class="syntaxkeyword">!</span><span class="syntaxdefault">preg_match</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"/^\d{3,5}$/"</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> trim</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Vorwahl'</span><span class="syntaxkeyword">]))or<br /></span><span class="syntaxdefault">                $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Rufnummer'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxstring">""</span><span class="syntaxdefault"> or<br />                </span><span class="syntaxkeyword">!</span><span class="syntaxdefault">preg_match</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"/^\d{3,12}$/"</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> trim</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Rufnummer'</span><span class="syntaxkeyword">]))or<br /></span><span class="syntaxdefault">                $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'ihmaehl'</span><span class="syntaxkeyword">]==</span><span class="syntaxstring">""</span><span class="syntaxdefault"> or<br />                </span><span class="syntaxkeyword">!</span><span class="syntaxdefault">preg_match</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$suchmuster</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'ihmaehl'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">,</span><span class="syntaxdefault">trim</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'ihmaehl'</span><span class="syntaxkeyword">])</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">)</span><span class="syntaxdefault">  or<br />                </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'workshop1'</span><span class="syntaxkeyword">]==</span><span class="syntaxstring">""</span><span class="syntaxdefault"> and  $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'workshop2'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxstring">""</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> or </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'workshop'</span><span class="syntaxkeyword">])</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxstring">""<br /><br /><br /><br /></span><span class="syntaxdefault">        </span><span class="syntaxkeyword">)<br /><br /><br /><br />{<br /><br /></span><span class="syntaxdefault">?><br /></span><br /><form name="anmeldungtsii"  method="post" action="Onlineanmeldungtsii_work.php" ><br /><br /><br /><style type="text/css"><br />@import url(css/onlineform.css);<br /></style><br /><br /><br /><div id="Anmeldeform"><br /><br /><br /><br /><br /><input type="checkbox" name="workshop1" value="Workshop1">Workshop1<br>  <p><br /><input type="checkbox" name="workshop2" value="Workshop2">Workshop2<br>   <p><br /><input type="checkbox" name="workshop3" value="Workshop3">Workshop3<br>   <p><br /><br /><br /><br /><br /><table width="700px"><br />        <tr ><br /><br />            <td width="60%"><br /><br /><br /><br />           <br><br /><br />             <fieldset><br />                               <p><br />                                <label for="Anrede"class="kontaktf_abstand_checkbox">Anrede :*</label><br /><br />                                    <input type="radio" name="Anrede" value="Herr"  class="radio"<br /><br /><br /><br /><br />                                                    <span class="syntaxdefault"><?php<br />                                                                    if </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Anrede'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">"Herr"</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">                                                                    </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                                                                        echo </span><span class="syntaxstring">'checked = "checked" '</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                                                                    </span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault">                                                      ?><br /></span><br />                                                                 />Herr<br /><br />                                                                <input type="radio"<br />                                                                name="Anrede"<br />                                                                value="Frau"<br />                                                                class="radio"<br /><br /><br /><br />                                                    <span class="syntaxdefault"><?php<br />                                                                    if</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Anrede'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">"Frau"</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">                                                                    </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                                                                        echo </span><span class="syntaxstring">'checked = "checked" '</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                                                                    </span><span class="syntaxkeyword">}<br /><br /><br /></span><span class="syntaxdefault">                                                    ?><br /></span><br /><br />                                                                />Frau    <br> <br><br /><br />                                </p ><br /><br /><br />                                <p><br />                                            <label for="Titel" class="kontaktf_abstand">Titel :</label><br />                                            <input type="text"  class="Feld" id="Titel" name="Titel" size="32" /><br />                                </p><br /><br />                                <p><br />                                           <label for="Vorname" class="kontaktf_abstand">Vorname :* </label><br />                                           <input type="text"  class="Feld" class="Feld" value="<span class="syntaxdefault"><?php  echo $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Vorname'</span><span class="syntaxkeyword">];</span><span class="syntaxdefault"> ?></span>"id="Vorname" name="Vorname" size="32" /><br />                                </p><br /><br />                                <p><br />                                        <label for="Nachname"class="kontaktf_abstand">Nachname :* </label><br />                                         <input type="text"  class="Feld" value="<span class="syntaxdefault"><?php echo $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Nachname'</span><span class="syntaxkeyword">];</span><span class="syntaxdefault"> ?></span>"id="Nachname" name="Nachname" size="32" /><br />                                </p><br /><br /><br /><br />                                <p><br />                                        <label for="Strasse"class="kontaktf_abstand">Strasse/Hausnummer</label><br />                                        <input type="text"  class="Feld" value="<span class="syntaxdefault"><?php echo $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Strasse'</span><span class="syntaxkeyword">];</span><span class="syntaxdefault"> ?></span>" id="Strasse" name="Strasse" size="20" maxlength="40" />/<br />                                        <input type="text" value="<span class="syntaxdefault"><?php echo $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Hausnummer'</span><span class="syntaxkeyword">];</span><span class="syntaxdefault"> ?></span>" name="Hausnummer" size="5" maxlength="8" /><br /><br /><br /><br /><br /><br /><br /><br /><br />                                </p><br /><br />                                <p><br />                                        <label for="PLZ"class="kontaktf_abstand">Postleitzahl :*</label><br />                                        <input type="text"  class="Feld" value="<span class="syntaxdefault"><?php echo </span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'PLZ'</span><span class="syntaxkeyword">]);</span><span class="syntaxdefault"> ?></span>" name="PLZ" size="5" id="PLZ" maxlength="5"/><br />                                </p><br /><br />                                <p><br /><br />                                        <label for="Ort"class="kontaktf_abstand">Ort :*</label><br />                                        <input type="text"  class="Feld" value="<span class="syntaxdefault"><?php echo $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Ort'</span><span class="syntaxkeyword">];</span><span class="syntaxdefault"> ?></span>"name="Ort" id="Ort" size="32"/><br /><br />                                </p ><br /><br /><br />                                <p><br />                                        <label for="Vorwahl"class="kontaktf_abstand">Vorwahl/Rufnummer</label><br />                                        <input type="text"  class="Feld" value="<span class="syntaxdefault"><?php echo $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Vorwahl'</span><span class="syntaxkeyword">];</span><span class="syntaxdefault">?></span>"name="Vorwahl" size="5" maxlength="5"/>/<br /><br /><br /><br /><br /><br />                                       <!--   <label for="Rufnummer"></label> --><br />                                        <input type="text"  value="<span class="syntaxdefault"><?php echo $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Rufnummer'</span><span class="syntaxkeyword">];</span><span class="syntaxdefault"> ?></span>"name="Rufnummer" size="10" maxlength="12" /><br />                                </p><br /><br />                                <p><br />                                        <label for="ihmaehl"class="kontaktf_abstand">E-Mail :*</label><br />                                        <input type="text"  class="Feld"value="<span class="syntaxdefault"><?php echo $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'ihmaehl'</span><span class="syntaxkeyword">];</span><span class="syntaxdefault"> ?></span>"name="ihmaehl" id="ihmaehl" size="32" /><br />                                </p><br /><br /><br />                                   <div id="email"><br /><br /><br />                                         <input type="text" name="email" id="email" size="32" /><br /><br /><br />                                    </div><br /><br /><br /><br /><br />       <!--                        <p><br />                                      <label for="Erm&auml;ssigung" class="kontaktf_abstand_checkbox"> Erm&auml;ssigung:* </label><br />                                        <input type="radio"  name="Ermaessigung" value="Ja" class="radio"<br /><br /><br /><br /><br />                                                      /*          <span class="syntaxdefault"><?php<br /><br />                                                                             if</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Ermaessigung'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">"Ja"</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">                                                                            </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                                                                                echo </span><span class="syntaxstring">'checked = "checked" '</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                                                                            </span><span class="syntaxkeyword">}<br /><br /><br /></span><span class="syntaxdefault">                                                              ?></span>     */<br />                                                                            />Ja<br /><br />                                                                                        <input type="radio" name="Ermaessigung"  value="Nein" class="radio"<br /><br />                                                                <span class="syntaxdefault"><?php<br /><br />                                                                             if</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Ermaessigung'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">"Nein"</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">                                                                            </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                                                                                echo </span><span class="syntaxstring">'checked = "checked" '</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                                                                            </span><span class="syntaxkeyword">}<br /><br /><br /></span><span class="syntaxdefault">                                                                ?><br /></span><br />                                                                   <span class="syntaxdefault"><?php<br /><br />                                                                             if </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">isset </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'workshop1'</span><span class="syntaxkeyword">]))<br /></span><span class="syntaxdefault">                                                                            </span><span class="syntaxkeyword">{<br /><br /><br /></span><span class="syntaxdefault">                                                                                echo </span><span class="syntaxstring">'checked = "checked" '</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                                                                            </span><span class="syntaxkeyword">}<br /><br /><br /></span><span class="syntaxdefault">                                                                ?><br /></span><br /><br /><br /><br /><br /><br /><br />                                                                */<br />                                                                            />Nein<br />  --><br />  </td><br />     </fieldset><br /><br /><br />  <td valign="middle"><br />  <div id="fehleingabe"><br />  <span class="syntaxdefault"><?php<br />        if </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'absenden'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">"Ja"</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">        </span><span class="syntaxkeyword">{<br /><br /><br /></span><span class="syntaxdefault">            if</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Vorname'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">""</span><span class="syntaxkeyword">)<br /><br /></span><span class="syntaxdefault">            </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                  echo </span><span class="syntaxstring">"<p>Bitte Vornamen eingeben</p>"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">            </span><span class="syntaxkeyword">}<br /><br /></span><span class="syntaxdefault">              if</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Nachname'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">""</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">            </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                 echo </span><span class="syntaxstring">" <p >Bitte Nachnamen eingeben</p>"</span><span class="syntaxkeyword">;<br /><br /><br /></span><span class="syntaxdefault">            </span><span class="syntaxkeyword">}<br /><br /><br /></span><span class="syntaxdefault">            if</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Strasse'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">""</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">            </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                 echo </span><span class="syntaxstring">" <p>Bitte Strasse eingeben</p>"</span><span class="syntaxkeyword">;<br /><br /><br /></span><span class="syntaxdefault">            </span><span class="syntaxkeyword">}<br /><br /></span><span class="syntaxdefault">            if</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Hausnummer'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">""</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">            </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                echo </span><span class="syntaxstring">"<p>Bitte Hausnummer eingeben</p>"</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">            </span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment">//  --------------------------PLZ----------------------------------------------<br /><br /><br /></span><span class="syntaxdefault">       if</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'PLZ'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">""</span><span class="syntaxkeyword">)<br /><br /></span><span class="syntaxdefault">                </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                echo </span><span class="syntaxstring">" <p>Bitte PLZ eingeben</p>"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                </span><span class="syntaxkeyword">}<br /><br /></span><span class="syntaxdefault">            else<br />      </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">               if</span><span class="syntaxkeyword">(!</span><span class="syntaxdefault">preg_match</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"/^\d{5}$/"</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> trim</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'PLZ'</span><span class="syntaxkeyword">])))<br /></span><span class="syntaxdefault">                </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                echo </span><span class="syntaxstring">"<p></p>Keine g&uuml;ltige PLZ - Bitte nur Zahlen eingeben</p>"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                </span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault">    </span><span class="syntaxkeyword">}<br /></span><span class="syntaxcomment">// ------------------------Ort---------------------------------------------<br /><br /><br /><br /></span><span class="syntaxdefault">        if</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Ort'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">""</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">                </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">              echo </span><span class="syntaxstring">" <p>Bitte Ort eingeben</p>"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                </span><span class="syntaxkeyword">}<br /><br /></span><span class="syntaxcomment">//------------------------------------------------------------------------------<br /><br /></span><span class="syntaxdefault">        if</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Vorwahl'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">""</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">                </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                echo </span><span class="syntaxstring">"<p>Bitte Vorwahl eingeben </p>"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                </span><span class="syntaxkeyword">}<br /><br /></span><span class="syntaxdefault">                       else<br />                    </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                        if</span><span class="syntaxkeyword">(!</span><span class="syntaxdefault">preg_match</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"/^\d{3,5}$/"</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> trim</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Vorwahl'</span><span class="syntaxkeyword">])))<br /><br /></span><span class="syntaxdefault">                        </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                         echo </span><span class="syntaxstring">"<p></p>Bitte die Vorwahl korrigieren</p>"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                        </span><span class="syntaxkeyword">}<br /><br /><br /></span><span class="syntaxdefault">                    </span><span class="syntaxkeyword">}<br /></span><span class="syntaxcomment">//------------------------------Rufnummer------------------------------------------------------------------------<br /><br /></span><span class="syntaxdefault">            if</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Rufnummer'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">""</span><span class="syntaxkeyword">)<br /><br /></span><span class="syntaxdefault">                </span><span class="syntaxkeyword">{<br /><br /></span><span class="syntaxdefault">                echo </span><span class="syntaxstring">"<p>Bitte Rufnummer eingeben </p>"</span><span class="syntaxkeyword">;<br /><br /></span><span class="syntaxdefault">                </span><span class="syntaxkeyword">}<br /><br /></span><span class="syntaxdefault">                        else<br />                        </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                            if </span><span class="syntaxkeyword">(!</span><span class="syntaxdefault">preg_match</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"/^\d{3,12}$/"</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> trim</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Rufnummer'</span><span class="syntaxkeyword">])))<br /><br /></span><span class="syntaxdefault">                            </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                            echo </span><span class="syntaxstring">"<p>Bitte die Rufnummer korrigieren</p>"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                            </span><span class="syntaxkeyword">}<br /><br /></span><span class="syntaxdefault">                  </span><span class="syntaxkeyword">}<br /><br /><br /></span><span class="syntaxcomment">//------------------ihmaehl---------------------------------------------------------------<br /></span><span class="syntaxdefault"> </span><span class="syntaxcomment">// Kontrolle ob valide<br /><br /><br /><br /><br /><br /><br /></span><span class="syntaxdefault">           if</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'ihmaehl'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">""</span><span class="syntaxkeyword">)<br /><br /></span><span class="syntaxdefault">               </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                  echo </span><span class="syntaxstring">"<p>Bitte E-mail eingeben</p>"</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">               </span><span class="syntaxkeyword">}<br /><br /></span><span class="syntaxdefault">                   else<br />                    </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                       if </span><span class="syntaxkeyword">(!</span><span class="syntaxdefault">preg_match</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$suchmuster</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'ihmaehl'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">,</span><span class="syntaxdefault">trim</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'ihmaehl'</span><span class="syntaxkeyword">])</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">))<br /><br /></span><span class="syntaxdefault">                       </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                        echo </span><span class="syntaxstring">"<p>Bitte eine g&uuml;ltige Email-Adresse eingeben</p>"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                       </span><span class="syntaxkeyword">}<br /><br /></span><span class="syntaxdefault">                    </span><span class="syntaxkeyword">}<br /><br /><br /></span><span class="syntaxcomment">//--------------------Einverständnis-------------------<br /><br /><br /></span><span class="syntaxdefault">  if </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'einverstanden'</span><span class="syntaxkeyword">]==</span><span class="syntaxstring">""</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">         </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">             echo</span><span class="syntaxstring">"<p>Bitte geben Sie Ihr Einverst&auml;ndnis zur Speicherung"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">         </span><span class="syntaxkeyword">}<br /><br /><br />}<br /><br /></span><span class="syntaxdefault">?><br /></span> </div><br />     </td><br /><br /><br /><br /> </table><br /><br /> </fieldset><br />      <p>    Ich bin damit einverstanden, dass meine Daten gespeichert werden. Sie werden nicht an Dritte weitergegeben und nach dem Symposium gel&ouml;scht!</p><br /><br />                            <p><br /><br />                                    <br /><br />                                    <label for="einverstanden"class="kontaktf_abstand_einverst">Ja, ich bin damit einverstanden :</label><br /><br />                                    <input type="checkbox"    name="einverstanden"<br /><br />                                                    <span class="syntaxdefault"><?php<br />                                                                    if </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'einverstanden'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">"Ja"</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">                                                                    </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                                                                        echo </span><span class="syntaxstring">'checked = "checked" '</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                                                                    </span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault">                                                      ?><br /></span><br /><br /> </p></p> <br /><br /> <br /><br /> <p><br />                                <label for="button" class="kontakt_abstand_submit"> </label><br />                                <input name="Abschicken" value="Absenden" type="submit" class="button"/><br /><br />                            </p><br /><br /><br />                                         <input type="hidden" name="absenden" value="Ja" /><br /><br />              <p><br /><br />                    <legend>mit * gekennzeichnete Felder sind Pflichtfelder</legend><br /><br />             </p><br /><br /><br /></form><br /><br /></div><br /><br /><br /><br /><br /><br /><br /><br /> <span class="syntaxdefault"><?php<br /> </span><span class="syntaxkeyword">}<br /><br /><br /><br /></span><span class="syntaxdefault">         else              </span><span class="syntaxcomment">//Abspeichern in eine Textdatei<br /><br /></span><span class="syntaxdefault">        </span><span class="syntaxkeyword">{<br /><br /></span><span class="syntaxdefault">                             $handle </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> fopen</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"anmeldung/Anmeldungeinzel.txt"</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"a"</span><span class="syntaxkeyword">);<br /><br /><br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> html_entity_decode</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Nachname'</span><span class="syntaxkeyword">])</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                               fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"     "</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                               fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">html_entity_decode</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Vorname'</span><span class="syntaxkeyword">])</span><span class="syntaxdefault">  </span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                                fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"        |       "</span><span class="syntaxkeyword">);<br /><br /><br /></span><span class="syntaxdefault">                              fwrite</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> $datum</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"     "</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                               fwrite</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Anrede'</span><span class="syntaxkeyword">]);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"     "</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">html_entity_decode</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Vorname'</span><span class="syntaxkeyword">])</span><span class="syntaxdefault">  </span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"     "</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> html_entity_decode</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Nachname'</span><span class="syntaxkeyword">])</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"     "</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> html_entity_decode</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Strasse'</span><span class="syntaxkeyword">])</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"     "</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Hausnummer'</span><span class="syntaxkeyword">]);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"     "</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'PLZ'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"     "</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> html_entity_decode</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Ort'</span><span class="syntaxkeyword">])</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"     "</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Vorwahl'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"/"</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Rufnummer'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"      "</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'ihmaehl'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"      "</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> html_entity_decode $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'workshop1'</span><span class="syntaxkeyword">]);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"      "</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> html_entity_decode $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'workshop2'</span><span class="syntaxkeyword">]);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"      "</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> html_entity_decode $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'workshop3'</span><span class="syntaxkeyword">]);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"      "</span><span class="syntaxkeyword">);<br /><br /></span><span class="syntaxdefault">                              </span><span class="syntaxcomment">//fwrite ($handle, $_POST['Ermaessigung'] );<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"\r\n"</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fwrite </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"\r\n"</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">                              fclose </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">;<br /><br /><br /></span><span class="syntaxdefault"> </span><span class="syntaxcomment">// und dann noch ihmaehl an den Webmaster<br /><br /></span><span class="syntaxdefault"> </span><span class="syntaxcomment">//header<br /><br /><br /></span><span class="syntaxdefault">      $header </span><span class="syntaxkeyword">=</span><span class="syntaxdefault">   </span><span class="syntaxstring">'From: anmeldung@tsii-tuebingen.de'</span><span class="syntaxdefault">        </span><span class="syntaxkeyword">.</span><span class="syntaxstring">"\r\n"</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">.<br /></span><span class="syntaxdefault">              </span><span class="syntaxstring">'Reply-To: anmeldung@tsii-tuebingen.de'</span><span class="syntaxdefault">  </span><span class="syntaxkeyword">.</span><span class="syntaxstring">"\r\n"</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">.<br /></span><span class="syntaxdefault">             </span><span class="syntaxstring">'X-Mailer: PHP/'</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">.</span><span class="syntaxdefault"> phpversion</span><span class="syntaxkeyword">();<br /><br /><br /><br /></span><span class="syntaxdefault">                        $empfaenger     </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxstring">"anmeldung@tsii-tuebingen.de"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                        $inhaltsbetreff  </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxstring">"Einzelanmeldung TSII 2010"</span><span class="syntaxkeyword">;<br /><br /></span><span class="syntaxdefault">                        $inhaltmail  </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Anrede'</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxstring">"\r\n"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxdefault">html_entity_decode</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Vorname'</span><span class="syntaxkeyword">]);<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxstring">"\r\n"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxdefault">html_entity_decode</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Nachname'</span><span class="syntaxkeyword">]);<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxstring">"\r\n"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxdefault">html_entity_decode</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Strasse'</span><span class="syntaxkeyword">]);<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxstring">"\r\n"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Hausnummer'</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxstring">"\r\n"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'PLZ'</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxstring">"\r\n"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxdefault">html_entity_decode</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Ort'</span><span class="syntaxkeyword">]);<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxstring">"\r\n"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'ihmaehl'</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxstring">"\r\n"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Vorwahl'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">.</span><span class="syntaxstring">" / "</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Rufnummer'</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxstring">"\r\n"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'workshop1'</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxstring">"\r\n"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'workshop2'</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxstring">"\r\n"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'workshop3'</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault">                        $inhaltmail </span><span class="syntaxkeyword">.=</span><span class="syntaxstring">"\r\n"</span><span class="syntaxkeyword">;<br /><br /><br /></span><span class="syntaxdefault">                       </span><span class="syntaxcomment">// $inhaltmail .=$_POST['Ermaessigung'];<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></span><span class="syntaxdefault">                     echo $inhaltsmail</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">                      mail</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$empfaenger</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">$inhaltsbetreff</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">$inhaltmail</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">$header</span><span class="syntaxkeyword">);<br /><br /></span><span class="syntaxdefault">                        </span><span class="syntaxcomment">//Auswertung  alle Angaben liegen vor<br /></span><span class="syntaxdefault">                        echo </span><span class="syntaxstring">'<h3>Danke - Folgende Daten haben wir von Ihnen heute gespeichert!<h3 />'</span><span class="syntaxkeyword">;<br /><br /><br /><br /><br /><br /></span><span class="syntaxdefault">                             echo </span><span class="syntaxstring">"<li>Anrede: "</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">  $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Anrede'</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault">                             echo </span><span class="syntaxstring">"<li>Vorname: "</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">html_entity_decode  </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Vorname'</span><span class="syntaxkeyword">]);<br /></span><span class="syntaxdefault">                             echo </span><span class="syntaxstring">"<li>Nachname: "</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">html_entity_decode </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Nachname'</span><span class="syntaxkeyword">]);<br /></span><span class="syntaxdefault">                             echo </span><span class="syntaxstring">"<li>Strasse: "</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">html_entity_decode </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Strasse'</span><span class="syntaxkeyword">]);<br /></span><span class="syntaxdefault">                             echo </span><span class="syntaxstring">"<li>Hausnummer: "</span><span class="syntaxkeyword">.</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Hausnummer'</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault">                             echo </span><span class="syntaxstring">"<li>Postleitzahl: "</span><span class="syntaxkeyword">.</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'PLZ'</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault">                             echo </span><span class="syntaxstring">"<li>Ort: "</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">html_entity_decode</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Ort'</span><span class="syntaxkeyword">]);<br /></span><span class="syntaxdefault">                             echo </span><span class="syntaxstring">"<li>Vorwahl: "</span><span class="syntaxkeyword">.</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Vorwahl'</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault">                             echo </span><span class="syntaxstring">"<li>Rufnummer: "</span><span class="syntaxkeyword">.</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'Rufnummer'</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault">                             echo </span><span class="syntaxstring">"<li>E-mail: "</span><span class="syntaxkeyword">.</span><span class="syntaxdefault"> $_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'ihmaehl'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">;<br /><br /><br /><br /></span><span class="syntaxdefault">            </span><span class="syntaxkeyword">}<br /><br /><br /></span><span class="syntaxdefault">?></span>
  • Hallo KlausM!


    Folgende Fehler haben sich im deinem Script eingeschlichen:


    • Dein HTML-Code (<p><h2>Überschrift</h2></p>) bei der Überschrift ist falsch.
      Richig wäre: <h2>Überschrift</h2> (kein Absatz)
    • Der Escape-Code ist falsch.
      Richtig wäre:

      PHP
      1. <span class="syntaxdefault"><?php<br />foreach </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST as $index </span><span class="syntaxkeyword">=></span><span class="syntaxdefault"> $eintrag</span><span class="syntaxkeyword">){<br /></span><span class="syntaxdefault">    $escaped</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">$index</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> htmlentities</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$eintrag</span><span class="syntaxkeyword">);<br />}<br /></span><span class="syntaxdefault">?></span>
    • In deinem HTML-Code bei den Checkboxen solltest du, wenn du jede in eine neue Zeile bringen willst,
      "<p><input /></p>
      <p><input /></p>
      <p><input /></p>"
      oder
      "<input /><br/>
      <input /><br/>
      <input /><br/>
      schreiben (Labels noch hinzufügen).
    • Du hast keinerlei Schutz gegen Mail Header Injection


    Zu deinem Problem:
    Ich würde es so angehen, dass eine Variable angelegt wird, die du bei jedem angekreutzten Kästchen um 1 hochzählst.
    Zum Schluss überprüft su, ob 2 abgespeichert ist.

    PHP
    1. <span class="syntaxdefault"><?php<br />$workshops </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> 0</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">if </span><span class="syntaxkeyword">(isset(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'workshop1'</span><span class="syntaxkeyword">])){<br /></span><span class="syntaxdefault">    $workshops</span><span class="syntaxkeyword">++;<br />}<br /></span><span class="syntaxdefault">if </span><span class="syntaxkeyword">(isset(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'workshop3'</span><span class="syntaxkeyword">])){<br /></span><span class="syntaxdefault">    $workshops</span><span class="syntaxkeyword">++;<br />}<br /></span><span class="syntaxdefault">if </span><span class="syntaxkeyword">(isset(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'workshop2'</span><span class="syntaxkeyword">])){<br /></span><span class="syntaxdefault">    $workshops</span><span class="syntaxkeyword">++;<br />}<br /></span><span class="syntaxdefault">if </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$workshops </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> 2</span><span class="syntaxkeyword">){<br /></span><span class="syntaxdefault">    echo </span><span class="syntaxstring">"Richtig angekreuzt!"</span><span class="syntaxkeyword">;<br />}<br /></span><span class="syntaxdefault">?></span>


    Hoffe, ich konnte helfen.


    webmaster3000

  • &quot;webmaster3000&quot; schrieb:

    Zu deinem Problem:
    Ich würde es so angehen, dass eine Variable angelegt wird, die du bei jedem angekreutzten Kästchen um 1 hochzählst.
    Zum Schluss überprüft su, ob 2 abgespeichert ist.

    Ich würde das ganze ein wenig anders machen und zwar über ein Array :)

    Code
    1. <label><input type="checkbox" name="workshop[]" value="Morgens 1" /> 1. Morgens</label>
    2. <label><input type="checkbox" name="workshop[]" value="Morgens 2" /> 2. Morgens</label>
    3. <label><input type="checkbox" name="workshop[]" value="Morgens 3" /> 3. Morgens</label>
    4. ...

    unsere Variabel $_POST["workshop"] ist dein ein Array dessen Einträge wir mit sizeof() einfach zählen können :)

  • &quot;Sarkkan&quot; schrieb:

    Ich würde das ganze ein wenig anders machen und zwar über ein Array :)


    Die wollte er eingentlich umgehen, ist aber besser, weil man nicht für jedes Kästchen eine if-Bedingung braucht.


    webmaster3000

  • Hi,


    Vielen erstmal für die Antworten. Ich hab wie gesagt, dass meiste wieder vergessen was ich vor einem Jahr mal
    gemacht habe und muss mich wieder einarbeiten.
    Ich werde die nächsten Tage versuchen, Eure Anregungen umzusetzen und auch mein php-Wissen wieder etwas
    aufzufrischen.
    Ich finde es sehr positiv, dass Ihr mich ausserdem auf Fehler in meiner Seite hinweist...Super!
    Ich melde mich nochmal wie es geklappt hat.
    Muss den Kurs von Axel nochmal von vorne machen...


    Schönen Sonntag noch...


    Klaus

  • jetzt habe ich Dank Eurer Hilfe schon mal die Checkboxen eingefügt und angepasst


    PHP
    1. <span class="syntaxhtml"><br /> <span class="syntaxdefault"><?php<br /> </span><span class="syntaxkeyword">echo </span><span class="syntaxstring">'<td>'</span><span class="syntaxkeyword">;<br /> </span><span class="syntaxdefault">$workshops </span><span class="syntaxkeyword">= </span><span class="syntaxdefault">0</span><span class="syntaxkeyword">;<br /> if (isset(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'workshop1'</span><span class="syntaxkeyword">])){<br /> </span><span class="syntaxdefault">$workshops</span><span class="syntaxkeyword">++;<br /> }<br /> if (isset(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'workshop3'</span><span class="syntaxkeyword">])){<br /> </span><span class="syntaxdefault">$workshops</span><span class="syntaxkeyword">++;<br /> }<br /> if (isset(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'workshop2'</span><span class="syntaxkeyword">])){<br /> </span><span class="syntaxdefault">$workshops</span><span class="syntaxkeyword">++;<br /> }<br /> echo </span><span class="syntaxstring">'</td>' </span><span class="syntaxkeyword">;<br /><br /> echo </span><span class="syntaxstring">'<td>'</span><span class="syntaxkeyword">;<br /><br /><br /><br /> if (</span><span class="syntaxdefault">$workshops </span><span class="syntaxkeyword">== </span><span class="syntaxdefault">3</span><span class="syntaxkeyword">){<br /> echo </span><span class="syntaxstring">"Bitte mind. 1 bzw. max 2 Workshops ankreuzen"</span><span class="syntaxkeyword">;<br /> }<br /> if (</span><span class="syntaxdefault">$workshops </span><span class="syntaxkeyword">== </span><span class="syntaxdefault">0</span><span class="syntaxkeyword">){<br /> echo </span><span class="syntaxstring">"Bitte mind. 1 bzw. max 2 Workshops ankreuzen!"</span><span class="syntaxkeyword">;<br /> }<br /> echo </span><span class="syntaxstring">'</td>' </span><span class="syntaxkeyword">;<br /> </span><span class="syntaxdefault">?><br /></span></span>



    Chef wollte jetzt noch, dass auch nur ein Workshop besucht werden kann...naja, das ging schnell
    Jetzt noch checked = checked und ich spendiere Euch ein oder 2 Bier + Essen, wenn Ihr mal in Tübingen seid...
    Und mit der Mailinjection muss ich natürlich noch mal ran...


    Gruss Klaus

  • Guten Morgen :)


    Wozu ist den das <td> um die Auswertung der Checkboxen?


    Statt 2 if-Abfragen würde ich einfach abfragen ob $workshops > 2 ist, falls mal ein weiterer Workshop spontan dazu kommt o.Ä. :)

  • Zitat

    Wozu ist den das <td> um die Auswertung der Checkboxen?


    damit die Fehlermeldung neben den Checkboxen kommt.


    Zitat

    Statt 2 if-Abfragen würde ich einfach abfragen ob $workshops > 2 ist, falls mal ein weiterer Workshop spontan dazu kommt o.Ä


    wenn ich nur grösser 2 habe, dann fehlt mir die Bedingung falls gar keine Checkbox markiert ist, oder habe ich da ein Denkfehler...
    ..aber habe jetzt Bedingung so geändert, falls da doch mal mehr Workshops kommen sollten...aber ich glaube, dann brauchen wir
    irgendwann einen anderen Webmaster, der das 100% im Griff hat.


    PHP
    1. <span class="syntaxdefault"><br />  if </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$workshops </span><span class="syntaxkeyword">></span><span class="syntaxdefault"> 2</span><span class="syntaxkeyword">){<br /></span><span class="syntaxdefault">    echo </span><span class="syntaxstring">"Bitte  mind. 1 bzw. max 2 Workshops ankreuzen"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">    </span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault">        if </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$workshops </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> 0</span><span class="syntaxkeyword">){<br /></span><span class="syntaxdefault">    echo </span><span class="syntaxstring">"Bitte  mind. 1 bzw. max 2 Workshops ankreuzen!"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">    </span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault"> </span>


    Danke erstmal für die Rückmeldung
    Klaus

  • nochmal ich...
    warum ist der 2. bzw. 3 Label rot markiert ( also irgendwas fehlt - mein Editorproramm ist Webocton scriptly )
    Das mit checked - checked klappt ja nun mal.
    Leider hätte ich anstatt Workshop1 bzw. Workshop 2 usw. lieber die Ausgabe NIV, Airwaymanagement und Trachealkanülenwechsel
    bei der email an micht bzw. bei der Anmeldebestätigung. Naja, sind jetzt nur noch ein paar Kleinigkeiten.
    Muss dann mich nochmal mit meinem CSS und html auseinandersetzen, da die Checkboxen doch sehr wild in der Gegend rumstehen.




    PHP
    1. <span class="syntaxhtml"><label>NIV Beatmung</label>  <br><br /><br />    <input type="checkbox" name="workshop1"  value="Workshop1"<br />        <span class="syntaxdefault"><?php<br /><br />                if  </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'workshop1'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">"Workshop1"</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">                </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                    echo </span><span class="syntaxstring">'checked = "checked" '</span><span class="syntaxkeyword">;<br /><br /></span><span class="syntaxdefault">                </span><span class="syntaxkeyword">}<br /><br /><br /><br /></span><span class="syntaxdefault">   ?><br /></span><br /><br /><br />[color=#BF0000]<label>[/color]Airway Management</label>   <br><br /><br /><br />             <input type="checkbox" name="workshop2"  value="Workshop2"<br />              <span class="syntaxdefault"><?php<br />                      if  </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'workshop2'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">"Workshop2"</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">                </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                    echo </span><span class="syntaxstring">'checked = "checked" '</span><span class="syntaxkeyword">;<br /><br /></span><span class="syntaxdefault">                </span><span class="syntaxkeyword">}<br /><br /><br /></span><span class="syntaxdefault">  ?><br /></span><br />[color=#FF0000]<label>[/color]Trachealkn&uuml;lenwechsel</label>   <br><br /><br />           <input type="checkbox" name="workshop3"   value="Workshop3"<br /><br />        <span class="syntaxdefault"><?php<br /><br /><br />                  if  </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'workshop3'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">"Workshop3"</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">                </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">                    echo </span><span class="syntaxstring">'checked = "checked" '</span><span class="syntaxkeyword">;<br /><br /></span><span class="syntaxdefault">                </span><span class="syntaxkeyword">}<br /><br /></span><span class="syntaxdefault">      ?><br /></span></span>


    muss jetzt mal richtig arbeiten...hoffe, dass klappt besser :D

  • Code
    1. <input type="checkbox" name="workshop1" value="Workshop1"


    Da fehlt das schließende > :) Dann sollten auch deine labels wieder ihre normale Farbe haben :)


    lg


    PS: Bitte editiere doch deine Beiträge, wenn du etwas vergessen hast, statt einen neuen Beitrag zu schreiben. Danke. :)