Solved

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

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

717 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