[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2013-01-06
5
Medium Priority
?
171 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
rinfo earned 2000 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

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…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will learn how to dynamically set the form action using jQuery.
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…

656 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