PHP multiple page form - Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Webmaster Tech > Programming

WebmasterForums.com is the premier Forum on the internet. Registered Users do not see the above ads.
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 12-19-2011, 11:45 AM   #1 (permalink)
Junior Member
 
Join Date: Dec 2011
Posts: 1
Default PHP multiple page form

Hi

I have 1 form that I need to split into two. Currently all the data gets stored into a database.

I pass the data entered from page 1 to page 2 through the use of hidden fields. I have having trouble carrying across multiple checkbox values.

I'll start by explaining the form. It is an order samples form. So 1 person can order multiple samples. The samples ordered goes into a database on a new row as my client monitors how many samples are ordered.

Here is the layout of the checkboxes:
<input name="sample[]" type="checkbox" value="Sample1">
<input name="sample[]" type="checkbox" value="Sample2">
<input name="sample[]" type="checkbox" value="Sample3">
<input name="sample[]" type="checkbox" value="Sample4">

and heres my code to insert into the database
foreach ($_POST['sample'] as $value) {
$foo = mysql_query("Insert into table SET sample ='$value', othervalues.........);

The checkboxes will remain on page 1 and the other fields will go to page 2...

How can I carry the checkbox value to page two... then process the form and insert into the database?

Hope this makes sense...

Thanks

Last edited by idmidm; 12-19-2011 at 11:47 AM.
idmidm is offline   Reply With Quote
Sponsored Links
Advertisement
 
Old 12-20-2011, 06:30 AM   #2 (permalink)
Junior Member
 
Join Date: Nov 2011
Posts: 6
Default Re: PHP multiple page form

I Want To Learn C++
carmellabanker is offline   Reply With Quote
Old 12-26-2011, 11:01 PM   #3 (permalink)
Regular User
 
Join Date: Dec 2011
Posts: 17
Default Re: PHP multiple page form

hello
I think that Forms are part of virtually any web application today. They are the main method to receive input from people using the application. They range in size from one-field opt-in forms where you only enter your email address, to very long forms with tens or even hundreds of fields.

To make long forms user-friendlier, it is a good idea to span the form on multiple pages. This can make it easier to follow for the user, and we can also split the data in separate sections, based on the scope (for example separate personal customer information from payment data in a shopping cart checkout form).

One of the challenges that arise from splitting the form over multiple pages is passing the data from one page to another, as at the final point of the form, we have all the needed data ready for processing. We are going to look at two methods to do this: session variables and hidden input fields.
Thanks
Regards
iconweb

Last edited by iconweb; 12-26-2011 at 11:05 PM.
iconweb is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisement

» Advertisement

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare

» Advertisement

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 02:18 AM.


Powered by vBulletin® Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2
Webmaster Forums
Web Hosting | Chicago Web Hosting | Web Hosting