tags:

views:

13

answers:

2

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_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( "[email protected]", "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));
?>
A: 

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'];

FatherStorm
It doesn't make sense. I created two forms using the exact same approach. Once works and the other won't GET!! Augh!!
Erik
do a print_r($_GET);print_r($_REQUEST);print_r($_POST);
FatherStorm
Probably the other form has the attribute action="someurl.php?sender_first_name=somename".
Ed.C
A: 

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)

Ed.C