Dark Prince Posted January 17, 2012 Share Posted January 17, 2012 this is a weird error as because it was working fine before then all of the sudden I get this syntax error, unexpected ',' on the line it describes it doesn't make sense the , should be there. if($value1, $value2, $value3) { thats where it is giving the error makes no sense... Link to comment Share on other sites More sharing options...
Paul Swanson Posted January 17, 2012 Share Posted January 17, 2012 if () requires an expression, a list of values isn't allowed. If you are testing to see if all variables are true, you need to use a logical operator, either && (AND), or || (OR). See http://www.php.net/manual/en/control-structures.if.php If you are testing to see if all the variables evaluate to true, you should use: if ($value1 && $value2 && $value3) { If you are testing to see if any of them evaluate to true, you'll want: if ($value1 || $value2 || $value3) { 1 Link to comment Share on other sites More sharing options...
Recommended Posts