Seite 1 von 2 12 LetzteLetzte
Ergebnis 1 bis 10 von 11

Thema: Captcha in Kontaktformular einfügen

  1. #1
    PHP-Noob
    Gast

    Frage Captcha in Kontaktformular einfügen

    Guten Abend zusammen,

    ich möchte mein Kontaktformular mit einem Captcha versehen.

    Dazu habe ich mit die Anleitung auf
    http://stoppt-den-spam.info/webmaste...a/vorwort.html
    angesehen und war der Meinung, dass selbst ich das hinbekommen sollte.

    Ich hab also genau nach der Anleitung gearbeitet und ich bekomme die Fehlermeldung:
    Parse error: parse error in ..\kontakt\kontakt.php on line 10

    kontakt.php
    PHP-Code:
    //Einbindung des Captchas ins Script

    <?php
    session_start
    ();
    if(isset(
    $_SESSION['captcha_spam']) AND $_POST["sicherheitscode"] == $_SESSION['captcha_spam']){
    unset(
    $_SESSION['captcha_spam']);

    //Anfang Kontaktformular

    <?
      if (
    $int=="true") {
        
    $kontakt_txt="Bitte um Zugangsdaten fuer die internen Webseiten.";
      }
    ?>
    <table>
      <tr>
        <td valign=top width=460>
          <br>
          <table width=450 border=0 cellpadding=5 cellspacing=5>
            <tbody>
              <tr valign=bottom align=middle>
                <td height="366" align="center" valign="top">
                  <p align="left">
                    <font size="3">
                      <strong>
                        <em>
                          <font face="Arial, Helvetica, sans-serif">                        Kontakt - Ihre Nachricht an uns</font> <br><br></em>
                          <? if ($kontakt_b == "true" ) { 
                             echo 
    "<font face=\"Arial, Helvetica, sans-serif\">                        Bitte f&uuml;llen Sie alle notwendigen Felder aus.</font>";
                             }
                          
    ?>
                          <font face="Arial, Helvetica, sans-serif" color="#DD2222">    </font>
                             
                          
                        </strong>
                    </font>
                  </p>
          
                  <form name="" method="post" <? //action="mail.php" 
    ?> >
                    <table width="450" border="0" height="215" cellspacing="5">
                      <tr>
                        <td colspan="5" valign="top" align="left" height="240">
                          <table width="97%" border="0">
                           <tr>
                              <td width="26%">
                                <font face="Arial, Helvetica, sans-serif" >
                                                              Empf&auml;nger:
                                </font>
                              </td>
                              <td width="4%">
                                <font face="Arial, Helvetica, sans-serif">                              &nbsp;
                                </font>
                              </td>
                              <td width="70%">
                                <font face="Arial, Helvetica, sans-serif">
                                 <select name="Empfaenger">
                                  <option value="Allgemein" <? if ($kontakt_to == "Allgemein" ) {echo "selected";} ?> >
                                  Allgemein  </option>
                                  <option value="AusbildungMF" <? if ($kontakt_to == "AusbildungMF" ) {echo "selected";} ?> >
                                  Ausbildungsleitung Motorflug</option>
                                  <option value="AusbildungSF" <? if ($kontakt_to == "AusbildungSF" ) {echo "selected";} ?> >
                                  Ausbildungsleitung Segelflug</option>
                                  <option value="Jugendleitung" <? if ($kontakt_to == "Jugendleitung" ) {echo "selected";} ?> >
                                  Jugendleitung </option>
                                  <option value="Vorstand" <? if ($kontakt_to == "Vorstand" ) {echo "selected";} ?> >
                                  Vorstand </option>
                                  <?  if ($int=="true") {
                                     echo 
    "<option value=\"Intern\" selected> Intern </option>";
                                  }
                                  
    ?>
                                  
                                  </select>
                                 </font>
                              </td>
                            </tr>
                           
                            <tr>
                              <td width="26%">
                                <font face="Arial, Helvetica, sans-serif" 
                                <? if ( $kontakt_name== "" and $kontakt_b == "true" ) {
                                echo 
    "color=\"".$kontakt_color."\"><b";
                                 }
                                
    ?> >
                                                              Name:*
                                <? if ( $kontakt_name== "" and $kontakt_b == "true") {
                                echo 
    "</b>";
                                 }
                                
    ?></font>
                              </td>
                              <td width="4%">
                                <font face="Arial, Helvetica, sans-serif">                              &nbsp;
                                </font>
                              </td>
                              <td width="70%">
                                <font face="Arial, Helvetica, sans-serif">
                                  <input name="Name" type="Text" size="24" value=<? echo $kontakt_name?> >
                                </font>
                              </td>
                            </tr>
                            <tr>
                              <td width="26%">
                                <font face="Arial, Helvetica, sans-serif">                              Firma / Verein:
                                </font>
                              </td>
                              <td width="4%">
                                <font face="Arial, Helvetica, sans-serif">                              &nbsp;
                                </font>
                              </td>
                              <td width="70%">
                                <font face="Arial, Helvetica, sans-serif">
                                  <input name="Firma" type="Text" size="24">
                                </font>
                              </td>
                            </tr>
                            <tr>
                              <td width="26%">
                                <font face="Arial, Helvetica, sans-serif"                              
                                <? if ( !eregi('@'$kontakt_email) and $kontakt_b == "true" ) {
                                echo 
    "color=\"".$kontakt_color."\"><b";
                                 }
                                
    ?> >
                                                              Email:*
                                <? if ( $kontakt_email== "" and $kontakt_b == "true") {
                                echo 
    "</b>";
                                 }
                                
    ?>
                                
                                </font>
                              </td>
                              <td width="4%">
                                <font face="Arial, Helvetica, sans-serif">                              &nbsp;
                                </font>
                              </td>
                              <td width="70%">
                                <font face="Arial, Helvetica, sans-serif">
                                  <input name="Email" type="Text" size="24" value=<? echo $kontakt_email?> >
                                </font>
                              </td>
                            </tr>
                            <tr>
                              <td width="26%">
                                <font face="Arial, Helvetica, sans-serif">                              Telefonnumer:
                                </font>
                              </td>
                              <td width="4%">
                                <font face="Arial, Helvetica, sans-serif">                              &nbsp;
                                </font>
                              </td>
                              <td width="70%">
                                <font face="Arial, Helvetica, sans-serif">
                                  <input name="Tel" type="Text" size="24">
                                </font>
                              </td>
                            </tr>
                            <tr>
                              <td width="26%">
                                <font face="Arial, Helvetica, sans-serif">                              Fax:
                                </font>
                              </td>
                              <td width="4%">
                                <font face="Arial, Helvetica, sans-serif">                              &nbsp;
                                </font>
                              </td>
                              <td width="70%">
                                <font face="Arial, Helvetica, sans-serif">
                                  <input name="Fax" type="Text" size="24">
                                </font>
                              </td>
                            </tr>
                            <tr>
                              <td width="26%" align="left" valign="top">
                                <font face="Arial, Helvetica, sans-serif"                              
                                <? if ( $kontakt_txt== "" and $kontakt_b == "true" ) {
                                echo 
    "color=\"".$kontakt_color."\"><b";
                                 }
                                
    ?> >
                                Raum                              f&uuml;r Ihre Mitteilung:*
                                <? if ( $kontakt_txt== "" and $kontakt_b == "true") {
                                echo 
    "</b>";
                                 }
                                
    ?> 
                                
                                </font>
                              </td>
                              <td width="4%">
                                <font face="Arial, Helvetica, sans-serif">                              &nbsp;
                                </font>
                              </td>
                              <td width="70%">
                                <font face="Arial, Helvetica, sans-serif">
    <textarea name="Text" cols="40" rows=8 wrap=virtual ><? echo $kontakt_txt?></textarea>
                                </font>
                              </td>
                            </tr>

    //Eingebauter Code fuer Captcha-Bild und Textfeld


                <tr>
                  <td width="26%" height="28%" align="left" valign="top">
                    Sicherheitscode:
                  </td>
                  <td width="4%" height="28%">
                  </td>
                  <td width="70%" height="28%">
                    <img src="captcha/captcha.php" border="0" title="Sicherheitscode">
                    <span style="padding-left:30px;"></span>
                    <input type="text" name="sicherheitscode" size="5">
                  </td>
                </tr>

                            <tr>
                              <td width="26%" align="left" valign="top" height="28">
                                <font size="1" face="Arial, Helvetica, sans-serif">                              *                              erforderliche Eingabe
                                </font>
                              </td>
                              <td width="4%" height="28">
                                <font face="Arial, Helvetica, sans-serif">                              &nbsp;
                                </font>
                              </td>
                              <td width="70%" height="28">
                                <font face="Arial, Helvetica, sans-serif">
                                  <input type="submit" name="Button" value="Abschicken">
                      <span style="padding-left:144px;"></span>
                                  <input type="reset" name="Button2" value="Zur&uuml;cksetzen">
                                </font>
                              </td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                    </table>
                  </form>
                </td>
              </tr>
          </table>
        </td>
      </tr>
    </table>


    }
    ?>
    Ich weiss leider nicht weiter und würd mich freuen, wenn ihr mir helft.

    Gruß
    Achtung: Dies ist ein alter Thread im HTML und Webmaster Forum
    Diese Diskussion ist älter als 90 Tage. Die darin enthaltenen Informationen sind möglicherweise nicht mehr aktuell. Erstelle bitte zu deiner Frage ein neues Thema im Forum !!!!!

  2. #2
    Bandit
    Gast

    Standard AW: Captcha in Kontaktformular einfügen

    Das ist das <? zuviel.

  3. #3
    PHP-Noob
    Gast

    Standard AW: Captcha in Kontaktformular einfügen

    Danke für die schnelle Antwort!

    Habe es rausgenommen - leider kommt dann die selbe Fehlermeldung mit der Zeilenangabe 245.


  4. #4
    Bandit
    Gast

    Standard AW: Captcha in Kontaktformular einfügen

    Aaaaaalso, ich habe ehrlich gesagt keine Lust, 245 Zeilen grausamen Quellcode durchzuforsten, um einen Fehler zu finden. Vermutlich hast du irgendwo eine Klammervergessen oder irgendwo fehlt ein " oder '

  5. #5
    PHP-Noob
    Gast

    Standard AW: Captcha in Kontaktformular einfügen

    Eigentlich kann der Fehler doch nur bei dem eingebundenden Code liegen, oder!?

    Das Formular hat ja vorher funktioniert.

    Ganz am Anfang vom Script hab ich diesen Teil eingefügt:
    PHP-Code:
    <?php
    session_start
    ();
    if(isset(
    $_SESSION['captcha_spam']) AND $_POST["sicherheitscode"] == $_SESSION['captcha_spam']){
    unset(
    $_SESSION['captcha_spam']);
    Danach kommt die Einbindung von Captchabild + Textfeld:
    PHP-Code:
    <tr>
                  <
    td width="26%" height="28%" align="left" valign="top">
                    
    Sicherheitscode:
                  </
    td>
                  <
    td width="4%" height="28%">
                  </
    td>
                  <
    td width="70%" height="28%">
                    <
    img src="captcha/captcha.php" border="0" title="Sicherheitscode">
                    <
    span style="padding-left:30px;"></span>
                    <
    input type="text" name="sicherheitscode" size="5">
                  </
    td>
                </
    tr
    Und zum Schluss:
    PHP-Code:
    }
    ?> 

  6. #6
    Bandit
    Gast

    Standard AW: Captcha in Kontaktformular einfügen

    Das Ende muss so aussehen:
    PHP-Code:
    <?php

    ?>

  7. #7
    PHP-Noob
    Gast

    Standard AW: Captcha in Kontaktformular einfügen

    Hab die Kommentierungen rausgenommen und deine Änderungen eingefügt. Jetzt kommt zwar keine Fehlermeldung mehr aber sonst auch nichts. Es wird eine leere Seite ausgegeben.

    Code ohne Kommentierungen mit Änderungen:
    PHP-Code:
    <?php
    session_start
    ();
    if(isset(
    $_SESSION['captcha_spam']) AND $_POST["sicherheitscode"] == $_SESSION['captcha_spam']){
    unset(
    $_SESSION['captcha_spam']);


      if (
    $int=="true") {
        
    $kontakt_txt="Bitte um Zugangsdaten fuer die internen Webseiten.";
      }
    ?>
    <table>
      <tr>
        <td valign=top width=460>
          <br>
          <table width=450 border=0 cellpadding=5 cellspacing=5>
            <tbody>
              <tr valign=bottom align=middle>
                <td height="366" align="center" valign="top">
                  <p align="left">
                    <font size="3">
                      <strong>
                        <em>
                          <font face="Arial, Helvetica, sans-serif">                        Kontakt - Ihre Nachricht an uns</font> <br><br></em>
                          <? if ($kontakt_b == "true" ) { 
                             echo 
    "<font face=\"Arial, Helvetica, sans-serif\">                        Bitte f&uuml;llen Sie alle notwendigen Felder aus.</font>";
                             }
                          
    ?>
                          <font face="Arial, Helvetica, sans-serif" color="#DD2222">    </font>
                             
                          
                        </strong>
                    </font>
                  </p>
          
                  <form name="" method="post" <? //action="mail.php" 
    ?> >
                    <table width="450" border="0" height="215" cellspacing="5">
                      <tr>
                        <td colspan="5" valign="top" align="left" height="240">
                          <table width="97%" border="0">
                           <tr>
                              <td width="26%">
                                <font face="Arial, Helvetica, sans-serif" >
                                                              Empf&auml;nger:
                                </font>
                              </td>
                              <td width="4%">
                                <font face="Arial, Helvetica, sans-serif">                              &nbsp;
                                </font>
                              </td>
                              <td width="70%">
                                <font face="Arial, Helvetica, sans-serif">
                                 <select name="Empfaenger">
                                  <option value="Allgemein" <? if ($kontakt_to == "Allgemein" ) {echo "selected";} ?> >
                                  Allgemein  </option>
                                  <option value="AusbildungMF" <? if ($kontakt_to == "AusbildungMF" ) {echo "selected";} ?> >
                                  Ausbildungsleitung Motorflug</option>
                                  <option value="AusbildungSF" <? if ($kontakt_to == "AusbildungSF" ) {echo "selected";} ?> >
                                  Ausbildungsleitung Segelflug</option>
                                  <option value="Jugendleitung" <? if ($kontakt_to == "Jugendleitung" ) {echo "selected";} ?> >
                                  Jugendleitung </option>
                                  <option value="Vorstand" <? if ($kontakt_to == "Vorstand" ) {echo "selected";} ?> >
                                  Vorstand </option>
                                  <?  if ($int=="true") {
                                     echo 
    "<option value=\"Intern\" selected> Intern </option>";
                                  }
                                  
    ?>
                                  
                                  </select>
                                 </font>
                              </td>
                            </tr>
                           
                            <tr>
                              <td width="26%">
                                <font face="Arial, Helvetica, sans-serif" 
                                <? if ( $kontakt_name== "" and $kontakt_b == "true" ) {
                                echo 
    "color=\"".$kontakt_color."\"><b";
                                 }
                                
    ?> >
                                                              Name:*
                                <? if ( $kontakt_name== "" and $kontakt_b == "true") {
                                echo 
    "</b>";
                                 }
                                
    ?></font>
                              </td>
                              <td width="4%">
                                <font face="Arial, Helvetica, sans-serif">                              &nbsp;
                                </font>
                              </td>
                              <td width="70%">
                                <font face="Arial, Helvetica, sans-serif">
                                  <input name="Name" type="Text" size="24" value=<? echo $kontakt_name?> >
                                </font>
                              </td>
                            </tr>
                            <tr>
                              <td width="26%">
                                <font face="Arial, Helvetica, sans-serif">                              Firma / Verein:
                                </font>
                              </td>
                              <td width="4%">
                                <font face="Arial, Helvetica, sans-serif">                              &nbsp;
                                </font>
                              </td>
                              <td width="70%">
                                <font face="Arial, Helvetica, sans-serif">
                                  <input name="Firma" type="Text" size="24">
                                </font>
                              </td>
                            </tr>
                            <tr>
                              <td width="26%">
                                <font face="Arial, Helvetica, sans-serif"                              
                                <? if ( !eregi('@'$kontakt_email) and $kontakt_b == "true" ) {
                                echo 
    "color=\"".$kontakt_color."\"><b";
                                 }
                                
    ?> >
                                                              Email:*
                                <? if ( $kontakt_email== "" and $kontakt_b == "true") {
                                echo 
    "</b>";
                                 }
                                
    ?>
                                
                                </font>
                              </td>
                              <td width="4%">
                                <font face="Arial, Helvetica, sans-serif">                              &nbsp;
                                </font>
                              </td>
                              <td width="70%">
                                <font face="Arial, Helvetica, sans-serif">
                                  <input name="Email" type="Text" size="24" value=<? echo $kontakt_email?> >
                                </font>
                              </td>
                            </tr>
                            <tr>
                              <td width="26%">
                                <font face="Arial, Helvetica, sans-serif">                              Telefonnumer:
                                </font>
                              </td>
                              <td width="4%">
                                <font face="Arial, Helvetica, sans-serif">                              &nbsp;
                                </font>
                              </td>
                              <td width="70%">
                                <font face="Arial, Helvetica, sans-serif">
                                  <input name="Tel" type="Text" size="24">
                                </font>
                              </td>
                            </tr>
                            <tr>
                              <td width="26%">
                                <font face="Arial, Helvetica, sans-serif">                              Fax:
                                </font>
                              </td>
                              <td width="4%">
                                <font face="Arial, Helvetica, sans-serif">                              &nbsp;
                                </font>
                              </td>
                              <td width="70%">
                                <font face="Arial, Helvetica, sans-serif">
                                  <input name="Fax" type="Text" size="24">
                                </font>
                              </td>
                            </tr>
                            <tr>
                              <td width="26%" align="left" valign="top">
                                <font face="Arial, Helvetica, sans-serif"                              
                                <? if ( $kontakt_txt== "" and $kontakt_b == "true" ) {
                                echo 
    "color=\"".$kontakt_color."\"><b";
                                 }
                                
    ?> >
                                Raum                              f&uuml;r Ihre Mitteilung:*
                                <? if ( $kontakt_txt== "" and $kontakt_b == "true") {
                                echo 
    "</b>";
                                 }
                                
    ?> 
                                
                                </font>
                              </td>
                              <td width="4%">
                                <font face="Arial, Helvetica, sans-serif">                              &nbsp;
                                </font>
                              </td>
                              <td width="70%">
                                <font face="Arial, Helvetica, sans-serif">
    <textarea name="Text" cols="40" rows=8 wrap=virtual ><? echo $kontakt_txt?></textarea>
                                </font>
                              </td>
                            </tr>

                <tr>
                  <td width="26%" height="28%" align="left" valign="top">
                    Sicherheitscode:
                  </td>
                  <td width="4%" height="28%">
                  </td>
                  <td width="70%" height="28%">
                    <img src="captcha/captcha.php" border="0" title="Sicherheitscode">
                    <span style="padding-left:30px;"></span>
                    <input type="text" name="sicherheitscode" size="5">
                  </td>
                </tr>

                            <tr>
                              <td width="26%" align="left" valign="top" height="28">
                                <font size="1" face="Arial, Helvetica, sans-serif">                              *                              erforderliche Eingabe
                                </font>
                              </td>
                              <td width="4%" height="28">
                                <font face="Arial, Helvetica, sans-serif">                              &nbsp;
                                </font>
                              </td>
                              <td width="70%" height="28">
                                <font face="Arial, Helvetica, sans-serif">
                                  <input type="submit" name="Button" value="Abschicken">
                      <span style="padding-left:144px;"></span>
                                  <input type="reset" name="Button2" value="Zur&uuml;cksetzen">
                                </font>
                              </td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                    </table>
                  </form>
                </td>
              </tr>
          </table>
        </td>
      </tr>
    </table>


    <?php

    ?>

  8. #8
    Bandit
    Gast

    Standard AW: Captcha in Kontaktformular einfügen

    Das wird wohl daran liegen, dass das Tutorial Kacke ist. Wenn das Script aufgerufen wird, ist $_SESSION['captcha_spam'] und $_POST['sicherheitscode'] nicht gesetzt sind.

  9. #9
    PHP-Noob
    Gast

    Standard AW: Captcha in Kontaktformular einfügen

    Hast du dafür vielleicht ne Lösung oder kannst mir eine andere Lösung empfehlen?

  10. #10
    Bandit
    Gast

    Standard AW: Captcha in Kontaktformular einfügen


Ähnliche Themen

  1. Kontaktformular in PHP Dropdown einfügen
    Von DennisP im Forum PHP Forum - Apache - CGI - Perl - JavaScript und Co.
    Antworten: 20
    Letzter Beitrag: 23.08.2009, 13:57
  2. in Kontaktformular Pflichtfelder einfügen
    Von Emmi im Forum PHP Forum - Apache - CGI - Perl - JavaScript und Co.
    Antworten: 1
    Letzter Beitrag: 22.08.2008, 14:33
  3. Mailform mit captcha
    Von synaptic im Forum PHP Forum - Apache - CGI - Perl - JavaScript und Co.
    Antworten: 11
    Letzter Beitrag: 06.07.2008, 04:17
  4. Plone friert bei Bild einfügen oder Link einfügen ein
    Von Daniel79 im Forum Zope & Plone - das deutsche Hilfeforum
    Antworten: 4
    Letzter Beitrag: 20.06.2008, 12:51
  5. Metags Einfügen bei T-online Hompage einfügen
    Von Sebastian.Wiedemann im Forum HTML & CSS Forum
    Antworten: 2
    Letzter Beitrag: 07.03.2007, 16:35

Stichworte

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •