Hi
I have a website which is ready to launch apart from one of the key request forms which is not working properly and I just can't understand why. I click 'submit' and the form stays on the screen. I get the following message:
Warning: Invalid argument supplied for foreach() in /home/brighttu/public_html/dev/request_tutor.php on line 499
Your request has been sent and you will be contacted by our Coordinator as soon as possible with a Tutor who matches your preferences.
The form does submit though and the record is added to the database:
There is a lot of code and I have no idea where the problem really lies, but here is the foreach() part:
$rqst_subject_1="";
$rqst_subject_2="";
$rqst_subject_3="";
$rqst_subject_4="";
$rqst_subject_all="";
foreach ($rqst_subject as $selectedsubject) //$rqst_level1
{
switch($cnt_subject)
{
case "1":
$rqst_subject_1=$selectedsubject;
$rqst_subject_all.=$selectedsubject."\n";
break;
case "2":
$rqst_subject_2=$selectedsubject;
$rqst_subject_all.="\t".$selectedsubject."\n";
break;
case "3":
$rqst_subject_3=$selectedsubject;
$rqst_subject_all.="\t".$selectedsubject."\n";
break;
case "4":
$rqst_subject_4=$selectedsubject;
$rqst_subject_all.="\t".$selectedsubject."\n";
break;
}
$cnt_subject++;
}`
The link to the website is: www.dev.bright-tutors.com
The form is: 'Request A Tutor'
I'm really desperate and would be so grateful for any help. Most of the form is in PHP and I couldn't see any sections for Jquery so apologise if I've posted this in the wrong area.
Many thanks