A little confused here. Where are the data from: posted by a user or taken from database?
If posted by a user, you can continue to use hidden method to pass along. Or you can send data to user directly from the page that processes the data. Let say, you have form.php (action=display.php) for customer to enter info, display.php to display info (action=process.php), and process.php to insert the info into database. On the process.php page, you can send email to your customer by using
mail ($email_to_, $subject, $messag_body, "From: $youremail\nX-Mailer: PHP/");
Of couse you need to assign values to $emai_to, ect. Within the $message_body, you can put posted data (as variables, e.g., $username), and format the body the way you want.
You can do this before or after inserting data into the database.
Another way to pass along data is to use session. For example, if you have a field in your submission form like this <input type=text (or hidden) name=price>, in display.php, it becomes $price accessbile anywhere within display.php. You can pass the value of this variable to session:
session_start(); //must start the session in the beginning of the file, or before sending any html code or text to browser.
$_SESSION[price]=$price;
You can use this variable by calling it $_SESSION[price] on any pages as long as that session lasts, and until you destroy the session.
Good luck
Originally posted by Adrian28uk
I am in the process of building my first shopping cart. Everything is working fine. On my payment page I collect the users product info and display this on the page, I also store these values in a hidden field. I want to be able to take these values over to a new page so that I can email the customer his/her order before passing the credit card details on to a secure server using a cgi called anyform. The secure server only accepts cgi scripts.
How do I do this since all the name values in the input type are called from the database and each one is different?
I only need to use the following lines of code to dynamically create the hidden fields before passing over to the next page but how can I catch these values.
<?php echo $row["qty"]; ?><input type="hidden" name="<? echo $row["itemName"]; ?> quantity required" value="<? echo $row["qty"]; ?>"></font> </td>
I look foward to seeing your ideas
Many Thanks
Adrian