I have added a checker to ensure that all fields in a form have data within when the form is submitted.
if( ( isset($_POST['name'] == "Contact") )
&& ( isset($_POST['company'] == "Company Name") )
&& ( isset($_POST['address'] == "Address") )
&& ( isset($_POST['turnover'] == "Approx. Turnover") )
&& ( isset($_POST['employees'] == "No. Of Employees") )
&& ( isset($_POST['contact'] == "Contact Number") )
)
{
//nothing has changed and we fail the form
$_SESSION['failed'] == true;
}
else{
I am getting the following error:
Parse error: syntax error, unexpected T_IS_EQUAL, expecting ‘,’ or ‘)’
Can anyone see what the problem is?
Also, will this check that all post values have data within?
Thanks.
should be
(or you can use
||if you wantOR)Also, it does not check if it has a value. It only checks if a variable is set.
Use either
== ''or empty() to check if it’s got a value.And
should be
==is for comparison and=is for assignment