Ergebnis 1 bis 2 von 2

Thema: Frage zum Php scribt

  1. #1
    HTML Newbie
    Registriert seit
    12.04.2006
    Beiträge
    5
    Danke
    0
    Bekam 0 mal "Danke" in 0 Postings

    Standard Frage zum Php scribt

    Hallo,

    wie schaffe ich es, dass sich die "Dankesseite" wenn man eine Mail geschrieben habt, im gleichen Fenster / Frame öffnet, wie dort wie das Formular eingebunden ist?

    Wer kann mir diesbezüglich helfen?

    Vielen Dank für eure Antworten!


    Code:
    <?php
    /* PHP Form Mailer - phpFormMailer v2.1, last updated 30th Nov 2005 - check back often for updates!
       &#40;easy to use and more secure than many cgi form mailers&#41; FREE from&#58;
                      www.TheDemoSite.co.uk
          Should work fine on most Unix/Linux platforms */
    
    // ------- three variables you MUST change below  -------------------------------------------------------
    $valid_ref1="http&#58;//www.XXXXXXXXX/contact.html";// chamge "Your--domain" to your domain
    $valid_ref2="http&#58;//www.XXXXX/contact.html";// chamge "Your--domain" to your domain
    $replyemail="info@XXXXXXX.de";//change to your email address
    // ------------------------------------------------------------
    
    //clean input in case of header injection attempts!
    function clean_input_4email&#40;$value, $check_all_patterns = true&#41;
    &#123;
     $patterns&#91;0&#93; = '/content-type&#58;/';
     $patterns&#91;1&#93; = '/to&#58;/';
     $patterns&#91;2&#93; = '/cc&#58;/';
     $patterns&#91;3&#93; = '/bcc&#58;/';
     if &#40;$check_all_patterns&#41;
     &#123;
      $patterns&#91;4&#93; = '/\r/';
      $patterns&#91;5&#93; = '/\n/';
      $patterns&#91;6&#93; = '/%0a/';
      $patterns&#91;7&#93; = '/%0d/';
     &#125;
     //NOTE&#58; can use str_ireplace as this is case insensitive but only available on PHP version 5.0.
     return preg_replace&#40;$patterns, "", strtolower&#40;$value&#41;&#41;;
    &#125;
    
    $name = clean_input_4email&#40;$_POST&#91;"name"&#93;&#41;;
    $email = clean_input_4email&#40;$_POST&#91;"email"&#93;&#41;;
    $thesubject = clean_input_4email&#40;$_POST&#91;"thesubject"&#93;&#41;;
    $themessage = clean_input_4email&#40;$_POST&#91;"themessage"&#93;, false&#41;;
    
    $error_msg='ERROR - not sent. Try again.';
    
    $success_sent_msg='<p align="center"></p>
                       <p align="center">Your message has been successfully sent to us
    
                        and we will reply as soon as possible.</p>
                       <p align="center">A copy of your query has been sent to you.</p>
                       <p align="center">Thank you for contacting us.</p>';
    
    $replymessage = "Hi $name
    
    Thank you for your email.
    
    We will endeavour to reply to you shortly.
    
    Please DO NOT reply to this email.
    
    Below is a copy of the message you submitted&#58;
    --------------------------------------------------
    Subject&#58; $thesubject
    Query&#58;
    $themessage
    --------------------------------------------------
    
    Thank you";
    
    // email variable not set - load $valid_ref1 page
    if &#40;!isset&#40;$_POST&#91;'email'&#93;&#41;&#41;
    &#123;
     echo "<script language=\"JavaScript\"><!--\n ";
     echo "top.location.href = \"$valid_ref1\"; \n// --></script>";
     exit;
    &#125;
    
    $ref_page=$_SERVER&#91;"HTTP_REFERER"&#93;;
    $valid_referrer=0;
    if&#40;$ref_page==$valid_ref1&#41; $valid_referrer=1;
    elseif&#40;$ref_page==$valid_ref2&#41; $valid_referrer=1;
    if&#40;!$valid_referrer&#41;
    &#123;
     echo "<script language=\"JavaScript\"><!--\n alert&#40;\"$error_msg\"&#41;;\n";
     echo "top.location.href = \"$valid_ref1\"; \n// --></script>";
     exit;
    &#125;
    $themessage = "name&#58; $name \nQuery&#58; $themessage";
    mail&#40;"$replyemail",
         "$thesubject",
         "$themessage",
         "From&#58; $email\nReply-To&#58; $email"&#41;;
    mail&#40;"$email",
         "Receipt&#58; $thesubject",
         "$replymessage",
         "From&#58; $replyemail\nReply-To&#58; $replyemail"&#41;;
    echo $success_sent_msg;
    /*
      PHP Form Mailer - phpFormMailer &#40;easy to use and more secure than many cgi form mailers&#41;
       FREE from&#58;
    
        www.TheDemoSite.co.uk       */
    ?>


    Code:
    <form name="phpformmailer" action="contact.php" align="center" method="post">
      <div align="center"><center><table bgcolor="#F2F2F2" width="528" cellspacing="6">
        <tr>
          <td width="159">Contact Us</td>
          <td width="349"></td>
        </tr>
        <tr>
          <td align="right" width="159">Your name&#58;</td>
          <td width="349"><font face="Arial"><input class="inputc" size="29" name="name"></font></td>
        </tr>
        <tr>
          <td align="right" width="159"><font color="#000080" size="1">*</font> Your email
          address&#58;</td>
          <td align="left" width="349"><font face="Arial"><input class="inputc" size="29"
          name="email"></font></td>
        </tr>
        <tr align="middle">
          <td align="right" width="159"><font color="#000080" size="1">*</font> Confirm email
          address&#58;</td>
          <td width="349" align="left"><font face="Arial"><input class="inputc" size="29"
          name="email2"></font></td>
        </tr>
        <tr>
          <td align="right" width="159"><font color="#000080" size="1">*</font> Subject&#58;</td>
          <td width="349"><font face="Arial"><input class="inputc" size="29" name="thesubject"></font></td>
        </tr>
        <tr>
          <td align="right" width="159">
    
    <font color="#000080" size="1">*</font> Your
          request or query&#58;</td>
          <td width="349"><textarea style="FONT-SIZE&#58; 10pt" name="themessage" rows="7" cols="27"></textarea></td>
        </tr>
        <tr>
          <td width="159"></td>
          <td width="349"><script language="JavaScript"><!--
    function validateForm&#40;&#41; 
    &#123;
     var okSoFar=true
     with &#40;document.phpformmailer&#41;
     &#123;
      var foundAt = email.value.indexOf&#40;"@",0&#41;
      if &#40;foundAt < 1 && okSoFar&#41;
      &#123;
        okSoFar = false
        alert &#40;"Please enter a valid email address."&#41;
        email.focus&#40;&#41;
      &#125;
      var e1 = email.value
      var e2 = email2.value
      if &#40;!&#40;e1==e2&#41; && okSoFar&#41;
      &#123;
        okSoFar = false
        alert &#40;"Email addresses you entered do not match.  Please re-enter."&#41;
        email.focus&#40;&#41;
      &#125;
      if &#40;thesubject.value=="" && okSoFar&#41;
      &#123;
        okSoFar=false
        alert&#40;"Please enter the subject."&#41;
        thesubject.focus&#40;&#41;
      &#125;
      if &#40;themessage.value=="" && okSoFar&#41;
      &#123;
        okSoFar=false
        alert&#40;"Please enter the details for your enquiry."&#41;
        themessage.focus&#40;&#41;
      &#125;
      if &#40;okSoFar==true&#41;  submit&#40;&#41;;
     &#125;
    &#125;
    // --></script><input type="button" class="button"
          value="Send" name="B1" ONCLICK="javascript&#58;validateForm&#40;&#41;"> <small>You must fill in
          the fields marked with a *</small></td>
        </tr>
      </table>
      </center></div>
    </form>
    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
    der/die Göttliche Avatar von jojo87
    Registriert seit
    23.03.2007
    Ort
    Leipzig
    Alter
    30
    Beiträge
    3.131
    Danke
    0
    Bekam 0 mal "Danke" in 0 Postings

    Standard

    setze in das form-tag noch target="deinframe" rein

Ähnliche Themen

  1. Frage
    Von Braungebrannter im Forum HTML & CSS Forum
    Antworten: 7
    Letzter Beitrag: 06.04.2008, 19:54
  2. Frage zu DIV
    Von Malcolm X im Forum HTML & CSS Forum
    Antworten: 5
    Letzter Beitrag: 31.08.2007, 00:31
  3. Registrierungs und Login Scribt Problem bin Anfänger(edit:1)
    Von Mr.IQ im Forum PHP Forum - Apache - CGI - Perl - JavaScript und Co.
    Antworten: 0
    Letzter Beitrag: 20.12.2006, 14:09
  4. Frage zu bewegten Fotos?! Frage zu graf. Menueleiste/Buttons
    Von Bianca im Forum Forum für Grafiken und Bildbearbeitung
    Antworten: 17
    Letzter Beitrag: 08.02.2006, 12:26
  5. Frage???
    Von Ilmer im Forum Computer - Internet Forum
    Antworten: 5
    Letzter Beitrag: 14.10.2005, 02:39

Stichworte

Berechtigungen

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