首页 文章

将URL查询变量传递给不同的表单

提问于
浏览
0

我需要将用户从php表单发送到另一个,但我也需要传递一个URL查询 . 所以他们到达example.com/Form1.php$email=Whatever@Whatever.com,然后他们需要传递给example.com/Form2.php$email=Whatever@whatever.com . 我无法在'' around the header('位置:http://www.example.com'中使用$ _GET;

见代码


<?php

$email = $_GET["email"];

$_POST['customerSatisfaction'];
    $to = "blah";
    $email_from = 'blah';
    $email_subject = "blah";
    $headers = "From: $email_from \r\n";
    $email_body =   "   <?xml version = \"1.0\"?>
    <?adf version = \"1.0\"?>
        <adf>

            <prospect>
                <customer>

                <email preferredcontact=\"1\">$email</email>

                </customer>

            </prospect>
        </adf>
";
    mail($to,$email_subject,$email_body,$headers);
    header('Location: http://www.BLAH.com/NEED $EMAIL HERE!!');
?>

1 回答

  • 2

    您发布的内容无效 . 试试这个:

    header('Location: http://www.BLAH.com/?email=' . urlencode($email));

    此外,在发送重定向标头后添加 exit; 通常也是个好主意 .

相关问题