Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 目标联系人表单重定向到感谢页面_Jquery_Redirect_Header_Contact Form_Window.open - Fatal编程技术网

Jquery 目标联系人表单重定向到感谢页面

Jquery 目标联系人表单重定向到感谢页面,jquery,redirect,header,contact-form,window.open,Jquery,Redirect,Header,Contact Form,Window.open,您好,我想有人帮我添加函数headerLocation:Thankyu.html或其他一些函数,将成功发送的电子邮件重定向到感谢页面。我在我下载的预填充脚本上尝试了几种方法,但都不起作用 该脚本附带3个文件:targetform.js、config_email.php和engine.php 我在此写下这三个文件的完整脚本 targetform.js engine.php config_email.php 我想我应该添加以下内容 标题'Location:page.php' 我想我应该在target

您好,我想有人帮我添加函数headerLocation:Thankyu.html或其他一些函数,将成功发送的电子邮件重定向到感谢页面。我在我下载的预填充脚本上尝试了几种方法,但都不起作用

该脚本附带3个文件:targetform.js、config_email.php和engine.php

我在此写下这三个文件的完整脚本

targetform.js

engine.php

config_email.php

我想我应该添加以下内容

标题'Location:page.php'

我想我应该在targetform.js文件的一节中输入它,该节在该行之后给出说明

成功:functionmsg {

但它不起作用。我还试过

打开窗户

但还是什么都没有

谢谢你的帮助! 注意:我写这篇文章是因为剧本的作者还没有回答我的问题,可能几周后就会回答
Elena

我解决了问题。我只是添加了以下内容:

success: function(msg)
  {

          $(".loader").hide();
          $("<div id='risultato'></div>").appendTo('#contact').html("<span>Email sent with success!</span>").delay(3000).fadeOut(timer);
          $("#bottone-contact").delay(2000).fadeIn(); 
          window.location='http://www.versiliarent.com/thanks.html'
  },
        <?php


        //Includo Variabili
        include('config_email.php');


        session_start();

            $nome       =   $_POST['nome'];
            $email      =   $_POST['email'];
            $oggetto    =   $_POST['oggetto'];
            $messaggio  =   $_POST['messaggio'];
            $ip         =   $_SERVER['REMOTE_ADDR'];

          if (empty($_POST['nome'])):
                exit;
            else:
            //Codice normale di invio
          endif;

        //Verifica antispam 

        if($_POST['fred'] != "") {
            echo('<p style="color: #000; font-size: 25px; font-weight: bold;">Are you a spambot or are you using undesired spam techniques? Sorry but your email has not been sent</p>');    
        }


        else {



    //Invio la mail

    $to         = $tua_email;
    $sbj        = "Richiesta Informazioni - $sito_internet";
    $msg        = "
    <html>
    <head>
    <style type='text/css'>
    body{
        font-family:'Lucida Grande', Arial;
        color:#333;
        font-size:15px;
    }
    </style>
    </head>
    <body>
    <table width='600' border='0' cellspacing='0' cellpadding='5'>
      <tr>
        <td width='121' align='right' valign='baseline'><strong>Nome:</strong></td>
        <td width='459'>$nome</td>
      </tr>


      <tr>
        <td align='right' valign='baseline'><strong>Email:</strong></td>
        <td>$email</td>
      </tr>

      <tr>
        <td width='121' align='right' valign='baseline'><strong>Oggetto:</strong></td>
        <td width='459'>$oggetto</td>
      </tr>


      <tr>
        <td align='right' valign='baseline'><strong>Richiesta:</strong></td>
        <td>$messaggio</td>
      </tr>


        <tr>
        <td align='right' valign='baseline'><strong>IP Tracciato (per motivi di sicurezza):</strong></td>
        <td>$ip</td>
      </tr>

       <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>

        <tr>
        <td>&nbsp;</td>
        <td><small>Powered by Targetweb.it | &copy; Copyright 2012 Riccardo Mel</small></td>
      </tr>

    </table>
    </body>
    </html>
    ";

    $from        = $email;
    $headers     = "MIME-Version: 1.0\n";
    $headers    .= "Content-type: text/html; charset=utf-8\n"; //In certi casi con aruba se non viene formattata eliminare il \r per i permessi come ho fatto in questo caso
    $headers    .= "From: $from";

    mail($to,$sbj,$msg,$headers); //Invio mail principale.

    //Fine mail inviata a me




    //Inizio email di conferma
    $toClient        = $email;
    $msgClient       = "
    <html>
    <head>
    <style type='text/css'>
    body{
        font-family:'Lucida Grande', Arial;
        color:#333;
        font-size:15px;
    }
    </style>
    </head>
    <body>

    <h1>Versilia Rent</h1>
    <br />
    <h2>www.versiliarent.com</h2>


    <h2>Automatic response</h2>
    <br />

       <p>Thanks for contact us, $nome</p>
        <p>We received your email. We will answer as soon as possible.</p>  

    </body>

    </html>
    ";
    $fromClient      = $tua_email;
    $sbjClient       = "Response to your information request Versilia Rent";
    $headersClient   = 'MIME-Version: 1.0' . "\r\n";
    $headersClient  .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headersClient  .= "From: $fromClient";

    mail($toClient,$sbjClient,$msgClient,$headersClient); //mail inviata al cliente

    //Fine email di conferma

    //Resetto errori

    session_destroy();

    exit;

    } //fine else del controllo antispam



    ?>
        <?php

        //file di configurazione variabili

        $tua_email = "n.pagnoni@alice.it";

        $sito_internet  =   "Versilia Rent";

        $grazie = "http://www.versiliarent.it";

    ?>
success: function(msg)
  {

          $(".loader").hide();
          $("<div id='risultato'></div>").appendTo('#contact').html("<span>Email sent with success!</span>").delay(3000).fadeOut(timer);
          $("#bottone-contact").delay(2000).fadeIn(); 
          window.location='http://www.versiliarent.com/thanks.html'
  },