Welcome to WebmasterWorld Guest from 126.96.36.199
I have a form that is processed by php, which generates a thank you page to the submitter. It's set so that the thank you page thanks the person by name...which I've done with no problems. However, I also want the referring url to be shown on the thank you page so that the person can click on it and be returned to the page he or she came from.
The form has this code:
$url = getenv("HTTP_REFERER");
<td><input name="url" value="<?php echo $url? >" type="hidden"></td>
The form_proc.php page has this code:
$First_Name = trim($First_Name);
$Last_Name = trim($Last_Name);
$email = trim($email);
$url = trim($url);
$Name = $First_Name . " " . $Last_Name;
foreach($HTTP_POST_VARS as $key => $value)
$message .= $key . ": " . $value;
$message .= "\n";
mail("firstname.lastname@example.org","Name of Form","$message","From: $Name <$email>");
header ("Location: thanks_cc.php?Name=$Name");
How do I append the $url to the header so that it appears on the thank you page, or is it not possible? I've tried comma, "+", etc., with no luck.
The thank you page is this:
<p>Thank you for your registration, <?php echo $Name?>. </p>
<p>Return to <a href="<?php echo $url?>">the page you came from.</a></p>
It's the Return to that I'm having trouble with. No matter what I do, the name and url just come through as one string.
Thanks for any help!