Log in

View Full Version : Personalise - Thank you /confirmation page



Rob (SA)
12-08-2010, 07:43 PM
Hi Folks,

I have a form that people populate with personal information, name, surname etc.

This information is stored in MySQL.

On submission of the data using the form a page is shown saying thank you.

I would like the name of the peron submitting the form to show in the thank you page.

I do not know how to write this script and would appreciate any help.

Regards
ROb

Schmoopy
12-08-2010, 07:58 PM
If you've got any code for the actual submission of the data, that would be useful, but I'll just go on what I might do.

Firstly, I'd do the actual form processing on the thank you page, this way you can use the post method and get the person's name that way. (Another way of doing it would be to do the processing on the first page and then redirect to the thank you page with a URL like thanks.php?name=Bob

But, for me it just seems neater doing it the first way:



<?php
if(isset($_POST['submit'])) {

// Do form processing
// Save stuff to database

// Somewhere in the data processing you get the value for the name
$name = $_POST['name'];

// Assuming that the database updating goes OK...
// Display thank you message

?>
<p>Thank you for your order <?php echo $name; ?>,</p>
<p>Bla bla bla...</p>
<?php

}
?>


If this doesn't make sense to you, or doesn't fit the way you're doing it right now, post what you've got so far and I'll see if I can adapt it.

Rob (SA)
12-08-2010, 08:22 PM
Hi,

Thanks for the prompt reply.

I have attached a txt file - maybe this will help

Regards
Rob