Solved

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

Posted on 2013-01-06
5
165 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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

810 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