Link to home
Start Free TrialLog in
Avatar of SlickCatSeven
SlickCatSeven

asked on

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

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.
ASKER CERTIFIED SOLUTION
Avatar of rinfo
rinfo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SlickCatSeven
SlickCatSeven

ASKER

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;
/*-----------------------------------------------------------------------------------
Have you checked whats there in the prop[].
Yup, it was a problem with prop[].
Aloha!