Im getting an error message and I have no idea why because there is nothing on the line in question (the last line of this code)
Note im building a multipage form using sessions to hold the values in an array which is highlighted in bold
<?php
//open the db connection
include("connect.php");
//carry on the session array thats holding the data values
session_start();
foreach($_POST as $key => $val)
{
$_SESSION[$key] = $val;
}
if (isset($_POST['Submit'])) {
$contact = $_POST['contact'];
$nameorg = $_POST['nameorg'];
$telephone = $_POST['telephone'];
$besttimecontact = $_POST['besttimecontact'];
$address1 = $_POST['address1'];
$address2 = $_POST['address2'];
$town = $_POST['town'];
$county = $_POST['county'];
$postcode = $_POST['postcode'];
$fax = $_POST['fax'];
$email = $_POST['email'];
$website = $_POST['website'];
$govoffreg = $_POST['govoffreg'];
$premises = $_POST['premises'];
$commitee = $_POST['commitee'];
$fundingsources = $_POST['fundingsources'];
$bmeorg = $_POST['bmeorg'];
$ethnicityusers = $_POST['ethnicityusers'];
$orgtype = $_POST['orgtype'];
$activities = $_POST['activities'];
$beneficiaries = $_POST['beneficiaries'];
$contactrole = $_POST['contactrole'];
$legalstatus = $_POST['legalstatus'];
$levelorg = $_POST['levelorg'];
$areaop = $_POST['areaop'];
$income = $_POST['income'];
$ft30plus = $_POST['ft30plus'];
$pt16hrs = $_POST['pt16hrs'];
$pt1630hrs = $_POST['pt1630hrs'];
$sessional = $_POST['sessional'];
$trainers = $_POST['trainers'];
$unclassified = $_POST['unclassified'];
$volunteer = $_POST['volunteer'];
$common_whatexpect = $_POST['common_whatexpect'];
$reliable = $_POST['reliable'];
$cheap = $_POST['cheap'];
$personalservice = $_POST['personalservice'];
$slow = $_POST['slow'];
$qualifiedstaff_people = $_POST['qualifiedstaff_people'];
$widechoice = $_POST['widechoice'];
$consistent = $_POST['consistent'];
$approachable = $_POST['approachable'];
$fitforpurpose = $_POST['fitforpurpose'];
$welleducated = $_POST['welleducated'];
$friendly = $_POST['friendly'];
$prompt = $_POST['prompt'];
$attentive = $_POST['attentive'];
$speedy = $_POST['speedy'];
$meetsneeds = $_POST['meetsneeds'];
$takeson = $_POST['takeson'];
$providesxtras = $_POST['providesxtras'];
$handson = $_POST['handson'];
$responsive = $_POST['responsive'];
$ltdselection = $_POST['ltdselection'];
$competent = $_POST['competent'];
$affordable = $_POST['affordable'];
$accessible = $_POST['accessible'];
$knowledgeable = $_POST['knowledgeable'];
$checkssatisfaction = $_POST['checkssatisfaction'];
$getsdetails = $_POST['getsdetails'];
$understands = $_POST['understands'];
$important1 = $_POST['important1'];
$important2 = $_POST['important2'];
$important3 = $_POST['important3'];
$important4 = $_POST['important4'];
$important5 = $_POST['important5'];
$nameofsystems = $_POST['nameofsystems'];
$not_adopting_sys_1 = $_POST['not_adopting_sys_1'];
$not_adopting_sys_2 = $_POST['not_adopting_sys_2'];
$not_adopting_sys_3 = $_POST['not_adopting_sys_3'];
$not_adopting_sys_4 = $_POST['not_adopting_sys_4'];
$not_adopting_sys_5 = $_POST['not_adopting_sys_5'];
$not_adopting_sys_6 = $_POST['not_adopting_sys_6'];
$not_adopting_sys_7 = $_POST['not_adopting_sys_7'];
$not_adopting_sys_8 = $_POST['not_adopting_sys_8'];
$sql = "INSERT INTO nottsvcs (contact, nameorg, telephone, besttimecontact
,address1
,address2
,town
,county
,postcode
,fax
,email
,website
,govoffreg
,premises
,commitee
,fundingsources
,bmeorg
,ethnictyusers
,orgtype
,activities
,beneficiaries
,contactrole
,legalstatus
,levelorg
,areaop
,incomeft30plus
,pt16hrs
,pt1630hrs
,sessional
,trainers
,unclassified
,volunteer
,common_whatexpec
,reliable
,cheap
,personalservice
,slow
,qualifiedstaff_people
,widechoice
,consistent
,approachable
,fitforpurpose
,welleducated
,friendly
,prompt
,attentive
,speedy
,meetsneeds
,takeson
,providesxtras
,handson
,responsive
,ltdselection
,competent
,affordable
,accessible
,knowledgeable
,checkssatisfaction
,getsdetails
,understands
,important1
,important2
,important3
,important4
,important5
,nameofsystems
,not_adopting_sys_1
,not_adopting_sys_2
,not_adopting_sys_3
,not_adopting_sys_4
,not_adopting_sys_5
,not_adopting_sys_6
,not_adopting_sys_7
,not_adopting_sys_8)
VALUES ($_SESSION'['$contact']'
,$_SESSION'['$nameorg']'
,$_SESSION'['$telephone']'
,$_SESSION'['$besttimecontact']'
,$_SESSION'['$address1']'
,$_SESSION'['$address2']'
,$_SESSION'['$town']'
,$_SESSION'['$county']'
,$_SESSION'['$postcode']'
,$_SESSION'['$fax']'
,$_SESSION'['$email']'
,$_SESSION'['$website']'
,$_SESSION'['$govoffreg']'
,$_SESSION'['$premises']'
,$_SESSION'['$commitee']'
,$_SESSION'['$fundingsources']'
,$_SESSION'['$bmeorg']'
,$_SESSION'['$ethnictyusers']'
,$_SESSION'['$orgtype']'
,$_SESSION'['$activities']'
,$_SESSION'['$beneficiaries']'
,$_SESSION'['$contactrole']'
,$_SESSION'['$legalstatus']'
,$_SESSION'['$levelorg']'
,$_SESSION'['$areaop']'
,$_SESSION'['$income']'
,$_SESSION'['$ft30plus']'
,$_SESSION'['$pt16hrs']'
,$_SESSION'['$pt1630hrs']'
,$_SESSION'['$sessional']'
,$_SESSION'['$trainers']'
,$_SESSION'['$unclassified']'
,$_SESSION'['$volunteer']'
,$_SESSION'['$common_whatexpect']'
,$_SESSION'['$reliable']'
,$_SESSION'['$cheap']'
,$_SESSION'['$personalservice']'
,$_SESSION'['$slow']'
,$_SESSION'['$qualifiedstaff_people']'
,$_SESSION'['$widechoice']'
,$_SESSION'['$consistent']'
,$_SESSION'['$approachable']'
,$_SESSION'['$fitforpurpose']'
,$_SESSION'['$welleducated']'
,$_SESSION'['$friendly']'
,$_SESSION'['$prompt']'
,$_SESSION'['$attentive']'
,$_SESSION'['$speedy']'
,$_SESSION'['$meetsneeds']'
,$_SESSION'['$takeson']'
,$_SESSION'['$providesxtras']'
,$_SESSION'['$handson']'
,$_SESSION'['$responsive']'
,$_SESSION'['$ltdselection']'
,$_SESSION'['$competent']'
,$_SESSION'['$affordable']'
,$_SESSION'['$accessible']'
,$_SESSION'['$knowledgeable']'
,$_SESSION'['$checkssatisfaction']'
,$_SESSION'['$getsdetails']'
,$_SESSION'['$understands']'
,$_SESSION'['$important1']'
,$_SESSION'['$important2']'
,$_SESSION'['$important3']'
,$_SESSION'['$important4']'
,$_SESSION'['$important5']'
,$_SESSION'['$nameofsystems']'
,$_SESSION'['$not_adopting_sys_1']'
,$_SESSION'['$not_adopting_sys_2']'
,$_SESSION'['$not_adopting_sys_3']'
,$_SESSION'['$not_adopting_sys_4']'
,$_SESSION'['$not_adopting_sys_5']'
,$_SESSION'['$not_adopting_sys_6']'
,$_SESSION'['$not_adopting_sys_7']'
,$_SESSION'['$not_adopting_sys_8']'
)"
or die (mysql_error());
//execute query and store the result
$res = mysql_query($sql,$connection);
if ($res) {
echo "Your survey has been submitted - thankyou<BR /><BR />";
} else {
echo "There was a problem with your post - please click the previous button and try again or contact the system administrator: tez@mindseyemidlands.co.uk<BR /><BR />";
}
?>
Tis is really bugging me (pardon the pun). Thanks in advance