在确认页面上放置表格结果不起作用!

时间:2010-10-22 20:26:32

标签: php

我无法弄清楚为什么名字没有在确认页面上找到?

<div class="tu">Thank you, <?php echo $_GET['sender_first_name']; ?>.</div>


<?php
$sender_first_name = $_REQUEST['sender_first_name'] ;
$sender_last_name = $_REQUEST['sender_last_name'] ;
$sender_email = $_REQUEST['sender_email'] ;
$sender_message = $_REQUEST['sender_message'] ;
$friend_first_name = $_REQUEST['friend_first_name'] ;
$friend_last_name = $_REQUEST['friend_last_name'] ;
$friend_email = $_REQUEST['friend_email'] ;


$Body = "";
$Body .= "Sender's First Name: ";
$Body .= $sender_first_name;
$Body .= "\n";
$Body .= "\n";
$Body .= "Sender's Last Name: ";
$Body .= $sender_last_name;
$Body .= "\n";
$Body .= "\n";
$Body .= "Sender's Email: ";
$Body .= $sender_email;
$Body .= "\n";
$Body .= "\n";
$Body .= "Sender's Message: ";
$Body .= $sender_message;
$Body .= "\n";
$Body .= "\n";
$Body .= "------------------------------------------------------------------ \n";
$Body .= "\n";
$Body .= "Friend's First Name: ";
$Body .= $friend_first_name;
$Body .= "\n";
$Body .= "\n";
$Body .= "Friend's Last Name: ";
$Body .= $friend_last_name;
$Body .= "\n";
$Body .= "\n";
$Body .= "Friend's Email: ";
$Body .= $friend_email;
$Body .= "\n";
$Body .= "\n";
$Body .= "Sent Date: ";
$Body .= date("Y-m-d H:i A e");

mail( "eriksnet@mac.com", "Message From Myorphan.com - Tell A Friend Request",
$Body, "From: $email" );

header("Location: http://www.feedmyorphan.com/friend_confirm.php?name=" . urlencode($sender_first_name));
?>

2 个答案:

答案 0 :(得分:0)

您确定该表单是通过GET而非POST提交的吗?如果您使用POST,那么您正在寻找$ _POST ['sender_first_name'];

答案 1 :(得分:0)

对我来说这看起来很明显! <div class="tu">Thank you, <?php echo $_GET['sender_first_name']; ?>.</div>

你确定它是$_GET[' ']吗?

我会去: <div class="tu">Thank you, <?php echo $_REQUEST['sender_first_name']; ?>.</div> 因为数据是从表单发送的,不是吗?

而且,$Body = "";不需要写。 (除其他外)