Hi guys,

It's my first time here in this forum. I have a problem regarding my application form (php mysql).

I have a checkbox option and for that I have set the type of field SET('1','2','3','4','5').

Here is my application:
<?php require_once('conn/name.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case 'array':
$theValue = is_array( $theValue)? join(',', $theValue): $theValue;
$theValue = "'" .
( function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue):
mysql_escape_string($theValue)
) ."'";
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO database (name, surname, gender, street, city, country, telephone, email, birthdate, citizenship, occupation, university, level, program, concentration, course, statement, trips, recommendation, dismissed, confirmation) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['name'], "text"),
GetSQLValueString($_POST['surname'], "text"),
GetSQLValueString($_POST['gender'], "text"),
GetSQLValueString($_POST['street'], "text"),
GetSQLValueString($_POST['city'], "text"),
GetSQLValueString($_POST['country'], "text"),
GetSQLValueString($_POST['telephone'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['birthdate'], "text"),
GetSQLValueString($_POST['citizenship'], "text"),
GetSQLValueString($_POST['occupation'], "text"),
GetSQLValueString($_POST['university'], "text"),
GetSQLValueString($_POST['level'], "text"),
GetSQLValueString($_POST['program'], "text"),
GetSQLValueString($_POST['concentration'], "text"),
GetSQLValueString($_POST['course[]'], "array"),
GetSQLValueString($_POST['statement'], "text"),
GetSQLValueString($_POST['tips'], "text"),
GetSQLValueString($_POST['recommendation'], "text"),
GetSQLValueString($_POST['dismissed'], "text"),
GetSQLValueString($_POST['confirmation'], "text"));

mysql_select_db($database_name, $name);
$Result1 = mysql_query($insertSQL, $name) or die(mysql_error());

$insertGoTo = "thankyou.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Program</title>
<!--
function MM_validateForm() { //v4.0
if (document.getElementById){
var i,p,q,nm,test,num,min,max,errors='',args=MM_valida teForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
} }
//-->
HTML code here
</body>
</html>
I'm missing the data that the user enters on the COURSE field!

Any help!