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.
Web Languages and Standards

Avatar of undefined
Last Comment
SlickCatSeven

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
rinfo

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
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;
/*-----------------------------------------------------------------------------------
rinfo

Have you checked whats there in the prop[].
SlickCatSeven

ASKER
Yup, it was a problem with prop[].
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
SlickCatSeven

ASKER
Aloha!