Forum Moderators: coopster
I have an application form that's processed by proc_form.php
<?php
foreach($HTTP_POST_VARS as $key => $value)
{
$message .= $key . ": " . $value;
$message .= "\n";
}
mail("me@mydomain.com","Page Title","$message","From: $name <$email>");
header ("Location: thanks.php?name=$name");
?>
I tried the above header line with just thanks.php and that only gives a thank you page that says, "Thanks, , blah blah" rather than "Thanks, Megan, blah, blah." So, I added the?name=$name thinking that it might pass along the variable from the application or proc_form.php. But it got the same result.
The thank you page is on a template (with graphics) to maintain the look of the site and the line of code is this:
Thank you for your application, <?php $name?>, we will review your information and contact you within 24 hours, excluding weekends and holidays.<br>
<p>Sincerely,<br>
A Company Name Here</p>
How do I get the values passed from proc_form to the thanks.php page so that the person's name shows on the thank you page? As you can probably tell, I'm new to php.
Thank you...
>>How do I get the values passed from proc_form to the thanks.php page
You should already be doing this by calling thanks.php?name=$name as the confirmation page. When you hit that page, PHP automatically creates a variable called 'name' with the value $name (which you set on your form page). Does the name get appended to the thanks page url correctly?
<added>Note - there should be a space before the question mark in the first like but the forum system is removing it</added>