[PHP] Kontaktformular fuktioniert nicht richtig

Dieses Thema im Forum "Webentwicklung" wurde erstellt von crix, 15. Dezember 2008 .

Status des Themas:
Es sind keine weiteren Antworten möglich.
  1. 15. Dezember 2008
    Kontaktformular fuktioniert nicht richtig

    Hallo liebe RR-Community,

    habe mal wieder irgendwo einen "kleinen" Fehler..
    Habe ein Kontaktformular.. alles Funktioniert auch einwandfrei. Außer die Ausgabe.. also die Weiterleitung zu http://www.domain.de/ok.php
    Hoffe ihr entdeckt den Fehler.. Wäre echt cool..

    PHP:
    <? php 
        error_reporting
    ( E_ALL );  
          
        if(isset(
    $_POST [ 'ueberpruefung' ]))   
      {   
      
    $allesok  1 ;   
        
     if(empty(
    $_POST [ 'nachname' ])){  
      
    $allesok  0 ;   
      
    $error [ nachname ] =  "Bitte einen Nachnamen eingeben!" ;}   

         if(empty(
    $_POST [ 'vorname' ])){  
      
    $allesok  0 ;   
      
    $error [ vorname ] =  "Bitte einen Vornamen eingeben!" ;} 
       
      if(empty(
    $_POST [ 'email' ])){  
      
    $allesok  0 ;   
      
    $error [ email ] =  "Bitte eine Emailadresse eingeben!" ;}   

      if(empty(
    $_POST [ 'strasse' ])){  
      
    $allesok  0 ;   
      
    $error [ strasse ] =  "Bitte eine Straße und Hausnummer eingeben!" ;} 
       
        if(empty(
    $_POST [ 'ort' ])){  
      
    $allesok  0 ;   
      
    $error [ ort ] =  "Bitte PLZ und Ort eingeben!" ;} 
       
        if(empty(
    $_POST [ 'nachricht' ])){  
      
    $allesok  0 ;   
      
    $error [ nachricht ] =  "Bitte eine Nachricht eingeben!" ;} 
         
      }  
        
      if(
    $allesok ){   
        

    // Empfänger 
    $empfaenger  .=  'info@domain.de'

    // Betreff 
    $betreff  'Kontaktformular'

    // Nachricht 
    $nachricht 
      Vorname : '
    . $_POST [ 'vorname' ]. ' <br> 
      Nachname : '
    . $_POST [ 'nachname' ]. ' <br>  
      Straße: '
    . $_POST [ 'strasse' ]. ' <br>  
      Stadt: '
    . $_POST [ 'ort' ]. ' <br>  
      Telefon: '
    . $_POST [ 'telefon' ]. ' <br>  
      Erreichbar: '
    . $_POST [ 'erreichbar' ]. ' <br>  
      Fax: '
    . $_POST [ 'fax' ]. ' <br> 
      Mobil: '
    . $_POST [ 'mobil' ]. ' <br>   
      Email: '
    . $_POST [ 'email' ]. ' <br>  
      Nachricht: '
    . $_POST [ 'nachricht' ].
    '


    // für HTML-E-Mails muss der 'Content-type'-Header gesetzt werden 
    $header   'MIME-Version: 1.0'  "\r\n"
    $header  .=  'Content-type: text/html; charset=iso-8859-1'  "\r\n"

    // zusätzliche Header 
    $header  .=  'To: Name <info@domain.de>'  "\r\n"
    $header  .=  'From: ' . $_POST [ 'vorname' ]. ' ' . $_POST [ 'nachname' ]. ' <' . $_POST [ 'email' ]. '>'  "\r\n"


    // verschicke die E-Mail 
    mail ( $empfaenger $betreff $nachricht , $header ) or die( "Es ist ein Error aufgetreten, bitte versuchen sie es erneut." ); 
        
    header ( "Location: http://www.domain.de/ok.php" ); 
        exit;   

      }  
        
      else  
      {  
      
    ?>  
    <html> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <title>Unbenanntes Dokument</title> 
    <style type="text/css"> 
    <!-- 
    .Stil2 { 
        font-family: Arial, Helvetica, sans-serif; 
        font-size: 12px; 

    .Stil22 {font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #FF0000; } 
    --> 
    </style> 
    </head> 

    <body> 
    <p class="Stil2"><img src="kontakth.png" width="80" height="16" /></p> 
    <p class="Stil2">Bei Fragen wenden sie sich bitte an<br> 
      <img src="kontakt.png" width="395" height="120" border="0" usemap="#Map1" /> 
      <map name="Map1" id="Map1"> 
        <area shape="rect" coords="36,70,144,82" href="mailto:info@mail.de" /> 
      </map> 
    </p> 
    <p class="Stil2">oder senden Sie schnell und einfach Ihre Anfrage mit diesem Kontaktformular</p> 
    <form action="<?php  echo  $_SERVER [ 'PHP_SELF' ] ?>" method="post" target="_self"> 
            <div class="infotext"><br></div> 
            <table border="0" cellpadding="0" cellspacing="5"> 
                <tr> 
                    <td><span class="Stil2">Vorname: *</span></td> 

                  <td><input name="vorname" type="text" value="<?php  echo  $_POST [ 'vorname' ]; ?>" size="50" maxlength="50"/>  
                  <span class="Stil22"><?php  echo  $error [ 'vorname' ]; ?></span></td> 
              </tr>     
                <tr> 
                    <td><span class="Stil2">Nachname: *</span></td> 
                  <td><input name="nachname" type="text" value="<?php  echo  $_POST [ 'nachname' ]; ?>" size="50" maxlength="50"/>  
                  <span class="Stil22"><?php  echo  $error [ 'nachname' ]; ?></span></td> 
              </tr>     
                <tr> 
                    <td><span class="Stil2">Stra&szlig;e / Hausnr.: *</span></td> 

                  <td><input name="strasse" type="text" value="<?php  echo  $_POST [ 'strasse' ]; ?>" size="50" maxlength="50"/>  
                  <span class="Stil22"><?php  echo  $error [ 'strasse' ]; ?></span></td> 
              </tr>     
                <tr> 
                    <td><span class="Stil2">PLZ / Ort: *</span></td> 
                  <td><input name="ort" type="text" value="<?php  echo  $_POST [ 'ort' ]; ?>" size="50" maxlength="50"/>  
                  <span class="Stil22"><?php  echo  $error [ 'ort' ]; ?></span></td> 
              </tr>     
                <tr> 
                    <td><span class="Stil2">Telefon:</span></td> 
                  <td><input name="tel" type="text" value="<?php  echo  $_POST [ 'tel' ]; ?>" size="50" maxlength="50"/></td> 
              </tr>     
                <tr> 
                    <td><span class="Stil2">Erreichbar (Datum/Zeit):</span></td> 
                  <td><input name="erreichbar" type="text" value="<?php  echo  $_POST [ 'erreichbar' ]; ?>" size="50" maxlength="255"/></td> 
              </tr>     
                <tr> 
                    <td><span class="Stil2">Fax:</span></td> 
                  <td><input name="fax" type="text" value="<?php  echo  $_POST [ 'fax' ]; ?>" size="50" maxlength="50"/></td> 
              </tr>     
                <tr> 

                    <td><span class="Stil2">Mobil:</span></td> 
                  <td><input name="mobil" type="text" value="<?php  echo  $_POST [ 'mobil' ]; ?>" size="50" maxlength="50"/></td> 
              </tr>     
                <tr> 
                    <td><span class="Stil2">E-Mail: *</span></td> 
                  <td><input name="email" type="text" value="<?php  echo  $_POST [ 'email' ]; ?>" size="50" maxlength="50"/> 
                  <span class="Stil22"> <?php  echo  $error [ 'email' ]; ?></span></td> 
              </tr>                     
                <tr> 
                    <td valign="top"><span class="Stil2">Ihr Anliegen: *</span></td> 

                    <td><span class="Stil2"> 
                      <textarea name="nachricht" cols="38" rows="6"><?php  echo  $_POST [ 'nachricht' ]; ?></textarea> 
    <span class="Stil22"><?php  echo  $error [ 'nachricht' ]; ?></span> 
                  <input type="hidden" name="ueberpruefung" value="1"></span></td> 
              </tr>     

                <tr> 
                    <td>&nbsp;</td> 
                    <td><div align="right"> 
                      <input type="submit" name="Submit" value="Absenden" /> 
                    </div></td> 
                </tr> 
            </table> 
    </form> 
    <p class="Stil2">&nbsp;</p> 
    <p class="Stil2">Text</p> 
    <p class="Stil2">&nbsp;</p> 
    <?php  

      
    }  
      
    ?>   
      </body> 
    </html>
    Danke für jede Hilfe!! BW ist natürlich klar!!

    crix
     
  2. 15. Dezember 2008
    AW: Kontaktformular fuktioniert nicht richtig

    bist du dir sicher?!?! also ich habs gerade mal getestet, bei mit funktioniert die weiterleitung auf jeden fall^^
     
  3. 15. Dezember 2008
    AW: Kontaktformular fuktioniert nicht richtig

    hää?! komischerweiße gehts.. vorher gings nicht.. ohne scheiß.. ^^
    danke euch trotzdem!!
    sorry
    *close*
     
  4. Video Script

    Videos zum Themenbereich

    * gefundene Videos auf YouTube, anhand der Überschrift.