Forum Moderators: coopster

Message Too Old, No Replies

Form Script with customized landing page.

         

GeekinNeed

4:24 pm on May 14, 2007 (gmt 0)

10+ Year Member



Here is what I am trying to accomplish:

A form that people will enter their info, and when the submit it, they will land on a page that shows the info they submitted for them to double check that it is the correct info before they confirm the submission.

I have an idea that I could create the landing page in html with tags like [firstname] and [address], and have the script replace those tags with the matching field data from the form. I just can't figure out HOW to do it.

Sorry if I'm rather incoherent - just spent a long night attempting to figure this out. I'm feeling very, VERY Dense, even with my very limited PHP knowledge. =/

Thanks

mcavic

4:49 pm on May 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I could create the landing page in html with tags like [firstname] and [address], and have the script replace those tags with the matching field data

Yes, you can do that using fopen(), fgets(), and preg_replace().

Or, you could just hard-code the HTML page into the PHP script.

jatar_k

5:24 pm on May 14, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld GeekinNeed

do you mean something like

this on your form
<input type="text" name="firstname">

then a submit button and on the next page

<p>You entered as your first name: <?php echo $_POST['firstname'];?>

then you could also have on that second page a form with hidden values and a submit button

<form name="doublecheck" action="somescript.php">
<input type="text" name="firstname" value="<?php echo $_POST['firstname'];?>">
<input type="submit" value="Yes, this is correct">
</form>

something like that?

remember I did no error checking at all in this example and you need to check all data submitted to your scripts.

GeekinNeed

5:25 pm on May 14, 2007 (gmt 0)

10+ Year Member



do you mean something like

this on your form
<input type="text" name="firstname">

then a submit button and on the next page

<p>You entered as your first name: <?php echo $_POST['firstname'];?>

then you could also have on that second page a form with hidden values and a submit button

<form name="doublecheck" action="somescript.php">
<input type="text" name="firstname" value="<?php echo $_POST['firstname'];?>">
<input type="submit" value="Yes, this is correct">
</form>

something like that?

YES! Exactly like that!

Thank you!

*goes off to try it*

[edited by: GeekinNeed at 5:28 pm (utc) on May 14, 2007]

moroose

7:50 am on May 28, 2007 (gmt 0)

10+ Year Member



Geekinneed
quote:
then you could also have on that second page a form with hidden values and a submit button

<form name="doublecheck" action="somescript.php">
<input type="text" name="firstname" value="<?php echo $_POST['firstname'];?>">

I still see input type="text" instead of input type="hidden",do you mean another hidden field to be added or you just forgot to modify it?
How about those select fields,i.e does one need to add a
value="<?php echo $_POST['Country'];?>"> or to each particular country option?
Thank you in advance!