Hello..
I have Two HTML form and one is a Check boxes form that enable users to select their category. Then I need to display second form according to the categories they selected in first form. I use this code in first form to validate form submission..
if ( isset( $_POST['category']) && sizeof( $_POST['category']) <= 3) {
$category = $_POST['category'];
} else {
$errors[] = 'Please select atleast 1, not more than 3 categories';
}
If errors array is empty I did this..
if ( empty( $errors )) { // If everything's OK
$_SESSION = $category;
$url = 'http://localhost/lanka_institute/tutorsignup/select_subjects.php? // Define the URL.
ob_end_clean(); // Delete the buffer.
header("Location: $url");
exit(); // Quit the script.
}
Can I know and is this correct? I display category list from mysql category table, it has category name and category id
this is my html part from first page
echo '<td width="50%"><input type="checkbox" name="category[]" vlaue="' . $info['category_id'] . '" /> ' . $info['category_name'] . '</td>';
any help appreciated.
Thanks in advance..