phpmaven

msg:3207070 | 6:14 pm on Jan 3, 2007 (gmt 0) |
You can create a confirmation page with a form with hidden input fields on it that hold the values from the previous form. IE: <input type="hidden" name="dept" value="<? echo $_POST['dept']?>"> The "submit" button could say "Confirm" or whatever. Then that form would when posted actually writes the data to your DB. The other option, which I would prefer, would be to display a Yes/No JavaScript dialog that displays the form values and then posts the form if the person clicks "Yes". [edited by: phpmaven at 6:19 pm (utc) on Jan. 3, 2007]
|
MC SAS Master

msg:3207075 | 6:17 pm on Jan 3, 2007 (gmt 0) |
Thanks for the response, I'm completely new to this so bear with me. How would I set up these "hidden" fields for the confirmation page and how do I like that page to the DB? What I had tried earlier was calling an PHP page called "output.php" from the "input.php" file but it didn't work. Again, thanks a million for your help. EDIT: So, are you saying I would put <input type="hidden" name="dept" value="<? echo $_POST['dept']?>"> into the input.php file? Would the input.php file now be: <?php echo '<br />'; echo 'Site: <b>'.$_POST['sites'].'</b><br />'; echo 'Department: <b>'.$_POST['dept'].'</b><br />'; echo 'Location of wreck: <b>' .$_POST['location'].'</b><br />'; <input type="hidden" name="dept" value="<? echo $_POST['dept']?>"> <input type="submit" value="Submit" /> ?> [edited by: MC_SAS_Master at 6:25 pm (utc) on Jan. 3, 2007]
|
phpmaven

msg:3207092 | 6:27 pm on Jan 3, 2007 (gmt 0) |
You would create a new script called "confirm.php" or whatever and display the results from the first form. Create a hidden form field for every field on the first form. For Example: input type="hidden" name="sites" value="<? echo $_POST['sites']?>" input type="hidden" name="dept" value="<? echo $_POST['dept']?>" input type="hidden" name="location" value="<? echo $_POST['location']?>" That form would then post to your "input.php" script. In fact, if you followed my example above, you shouldn't have to change anything in your "input.php" script.
|
MC SAS Master

msg:3207128 | 6:50 pm on Jan 3, 2007 (gmt 0) |
Thanks for all of your help, I really appreciate. I do, however, have one final question for you. My input.php file now looks like this: <?php echo '<br />'; echo 'Site: <b>'.$_POST['sites'].'</b><br />'; echo 'Department: <b>'.$_POST['dept'].'</b><br />'; echo 'Location of wreck: <b>' .$_POST['location'].'</b><br />'; ?> <input type="hidden" name="dept" value="<? echo $_POST['dept']?>"> <input type="submit" value="Confirm" /> Unfortunately, when hit the "Confirm" button nothing happens. Any idea as to what I'm doing wrong?
|
bartainer

msg:3210702 | 9:20 pm on Jan 6, 2007 (gmt 0) |
Is the information placed between the form tags? I have forgotten the <form> tag and the same thing happened to me. Also, how are you processing (action) the form? Bartainer
|
bartainer

msg:3210707 | 9:26 pm on Jan 6, 2007 (gmt 0) |
When I process my forms, all my html is inserted beneath the PHP code. That I call my "thank you" page (e.g. thankyou.php). I carry my variables echo $name (no hidden fields) over to the next page to personlaize my thank you page. Once the PHP is processed (validated) then the html will pick up. Html will not show until PHP is processed. Check your form tags.
|
MC SAS Master

msg:3212088 | 2:13 pm on Jan 8, 2007 (gmt 0) |
Thanks for the replies, I finally got the pages to work. Apparently the problem was with a Javascript I was using in the header.
|
|