Jump to content

re POSTing echo POST without INPUT


bcraig

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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']);

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.