Web Hosting Talk







View Full Version : PHP & Forms


ChrisMayhew
05-07-2005, 12:37 PM
Hello, i have a bit of a problem.

Im writing a little script but having some trouble. I have a form the user fills in and then it gives them a quote on the information they entered, then they have the option to enter the details to buy the items. My problem is with the quote not being able to be entered into a mysql database. I am guessing this is because it cannot be passed through 2 forms because the information isn't being passed through the second form onto my final page where it processes the MySQL Inputs.

I just don't know how i can make it so it will pass this information through the second form and store it in a MySQL database.

I really hope that hasn't confused you.

Any help would be great.

Thank you,
Chris Mayhew

stormraven
05-07-2005, 12:47 PM
You can..

1. Have the 2nd form read the variables from the 1st form, and store them in the 2nd form as "hidden" variables when the 2nd form is processed.

2. Have the 2nd form read the variables from the 1st form and store them in the session - to be processed when the 2nd form is processed.

Either way will work.

JieWei
05-08-2005, 04:57 AM
Can you paste the form here and the php code ? So we can look at it further, i guess it would be a better help =)

ChrisMayhew
05-08-2005, 05:39 AM
The 3 files are very big. It's just 2 standard html forms with php code to work out the quote when it goes onto the second page. From the second page i cannot get it to store what it has just worked out and returned to the user on screen.