Solved

PHP: Selected Checkboxes to MySQL DB Across 3 Web Pages in PHP

Posted on 2013-01-06
5
161 Views
Last Modified: 2013-01-09
Newbie here. Is the following possible?

Page 1: has a form with multiple checkboxes. All checkboxes are named prop[] (for real estate property) so they can be handled as a single item on submission to Page 2.

Page 2: User can select an existing list of properties or name a new one to be created, then submit to Page 3.

Page 3: Creates a new list of properties with the selected checkboxes from Page 1, or appends to an existing property list, to be stored in a MySQL db.

I was thinking of making an array with the checked values on Page 2, but still need to pass the array to Page 3 on submission, or perhaps with session variable, then INSERT INTO MySQL db.

Mahalo for any help.
0
Comment
Question by:SlickCatSeven
  • 3
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
rinfo earned 500 total points
ID: 38750480
setting session variable is the way to go about this.
keep on depositing in a session variable array values from page1,page2 and page3 and after page 3 on the session array variable you have an array with value from all pages.
Or you can have 3 session variable page1_option,page2_option and page3_option and finally combine them into an array.,
0
 

Author Comment

by:SlickCatSeven
ID: 38756826
Okay, I tried this for creating the session variable, but no values get stored.

/*-----------------------------------------------------------------------------------
$search_array = array();
            
for ($count = 0; $count <= count($_POST['prop[]']) - 1; $count++) {
   if ($_POST['prop[]'][$count] <> '') {
      $search_array = $_POST['prop[]'][$count];
   }
}

$_SESSION['$search_array'] = $search_array;
/*-----------------------------------------------------------------------------------
0
 
LVL 9

Expert Comment

by:rinfo
ID: 38757929
Have you checked whats there in the prop[].
0
 

Author Comment

by:SlickCatSeven
ID: 38760976
Yup, it was a problem with prop[].
0
 

Author Closing Comment

by:SlickCatSeven
ID: 38760978
Aloha!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
carriage return in xslt cell 13 60
XSL Grouping 7 36
Google adds suggestions 3 51
website content maintenance 3 57
Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now