bcraig Posted December 21, 2007 Share Posted December 21, 2007 Ive got a form for creating a record and it posts to a confirmation page. I want the confirmation page to echo all the POST data into another form which on submit will POST to a mysql INSERT query. Is this possible without having input fields on the confirmation page? or are there ways to set the input boxes to be invisable and only show the data and be non-editable?? PHP version:5.2.5 Quote Link to comment Share on other sites More sharing options...
Jessica Posted December 21, 2007 Share Posted December 21, 2007 You can use the disabled property, (http://www.htmlhelp.com/reference/html40/forms/input.html) or just print the data instead of printing it in a form. Quote Link to comment Share on other sites More sharing options...
bcraig Posted December 21, 2007 Author Share Posted December 21, 2007 but if the input is disabled it wont post again and the only way i know how to post is with a form Quote Link to comment Share on other sites More sharing options...
sculpy Posted December 21, 2007 Share Posted December 21, 2007 Possibly you could re-pass the data in a hidden input. <input type="hidden" name... Just like passing data from a text box. Quote Link to comment Share on other sites More sharing options...
roshanbh Posted December 21, 2007 Share Posted December 21, 2007 well bro there are two methods to do this ...in the previewing page you can use the hidden fileds in the form just like <input type='hidden' name='email' value="<?=$_POST['email']?>" /> or You can assin these values to the session variable in the preview page and insert the values of the session in the third page. http://php-ajax-guru.blogspot.com http://roshanbh.com.np Quote Link to comment Share on other sites More sharing options...
Jessica Posted December 21, 2007 Share Posted December 21, 2007 You could do this: <?php $_SESSION['posted'] = $_POST; //print out post data here as regular HTML, not a form. //Name: John Doe //Email: john@doe.com ?> Then on the next page, instead of processing the $_POST array, process the $_SESSION['posted'] array. Quote Link to comment Share on other sites More sharing options...
bcraig Posted December 21, 2007 Author Share Posted December 21, 2007 Cool thanks! I might try using session sometime but for now I think ill use <input type='hidden' name='email' value="<?php echo $_POST['email']?>" /><p><?php echo $_POST['email']?></p> Quote Link to comment Share on other sites More sharing options...
jitesh Posted December 21, 2007 Share Posted December 21, 2007 Its a better way that when you first post the data "Save Data in Session". Later on second post Collect data from session and save in Database. Example : (1) Save Data in sesison $_SESSION['data'] = array(); if(isset($_POST)){ foreach($_POST as $key => $value) $_SESSION['data'][$key] = $value; } (2) On Next page you will found all data in Array echo "<pre>"; print_r($_SESSION['data']); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.