OK- ive tried tunage's apprach and come out with an undefined error message e.g:
Notice: Undefined index: num_of_checkboxes in /disk1/home3/mindseye/public_html/nottsvcs_short_1_4_formhandler.php on line 193
Notice: Undefined index: list_quality_sys_1 in /disk1/home3/mindseye/public_html/nottsvcs_short_1_4_formhandler.php on line 202
Notice: Undefined index: list_quality_sys_2 in /disk1/home3/mindseye/public_html/nottsvcs_short_1_4_formhandler.php on line 203
Here is my code:
<?php
include("connect.php");
error_reporting(E_ALL);
ini_set('display_errors', '1');
if (isset($_POST['Submit'])) {
$contact = $_POST['contact'];
$nameorg = $_POST['nameorg'];
$telephone = $_POST['telephone'];
$num = $_POST['num_of_checkboxes'];
for ($i=0; $i<$num; $i++)
{
$check_name = "list_quality_sys_" . $i;
if (isset($_POST[$check_name])) echo "it was checked!";
else echo "it wasnt checked!";
}
$list_quality_sys_1 = $_POST['list_quality_sys_1'];
$list_quality_sys_2 = $_POST['list_quality_sys_2'];
$sql = "INSERT INTO nottsvcs (contact, nameorg, telephone,
,list_quality_sys_1, list_quality_sys_1)"
VALUES (
,'$contact'
,'$nameorg'
,'$telephone'
,'$list_quality_sys_1'
,'$list_quality_sys_1'
)"
or die (mysql_error());
//execute query and store the result
$res = mysql_query($sql,$connection);
echo $res;
if ($res) {
echo "Your survey has been submitted - thankyou<BR /><BR />";
exit;
} else {
echo "There was a problem with your post - please click the back button and try again.<BR /><BR />";
}
}
?>