Forum Moderators: coopster

Message Too Old, No Replies

Help with script: Personalized thanks page

         

meganp

2:43 pm on Jul 21, 2003 (gmt 0)

10+ Year Member



Hello,

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...

pixel_juice

2:48 pm on Jul 21, 2003 (gmt 0)

10+ Year Member



I'm not great at php, but I think you just need to change <?php $name?> to <?php echo $name?>

>>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>

meganp

3:33 pm on Jul 21, 2003 (gmt 0)

10+ Year Member



Thanks for the quick reply and help... that worked!

pixel_juice

3:38 pm on Jul 21, 2003 (gmt 0)

10+ Year Member



Glad that helped.

Please excuse my rudeness by the way - I forgot to say welcome to webmasterworld! :)

meganp

3:45 pm on Jul 21, 2003 (gmt 0)

10+ Year Member



Finding help so fast was a wonderful welcome! Thank you again.