开发者

Placing Form Result on confirmation page not working!

I can't figure out why the first name is not picking up on the confirmation page?

<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_ema开发者_StackOverflow中文版il'] ;


$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));
?>


Are you sure the form was submitted by way of GET and not POST? if you used POST then you're looking for $_POST['sender_first_name'];


It looks pretty obvious to me! <div class="tu">Thank you, <?php echo $_GET['sender_first_name']; ?>.</div>

Are you sure it is a $_GET[' ']?

I'd go for: <div class="tu">Thank you, <?php echo $_REQUEST['sender_first_name']; ?>.</div> Because the data was sent from a form, wasn't it?

And also, $Body = ""; does not need to be written. (among other stuff)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜