lostprophetpunk Posted January 8, 2010 Share Posted January 8, 2010 When processing a form I have created, I get the following error... Fatal error: Function name must be a string in C:\xampp\htdocs\new\contact.php on line 83 What would I need to do to fix this? The relevant PHP code is below... if(!$_POST['contact']) { //form html removed } else { //process form function cleanl($a) { $b = trim($a); $c = htmlentities($b); return $c; } $name = cleanl( $_POST['name'] ); $email = cleanl( $_POST['email'] ); $message = nl2br( cleanl( $_POST['message'] ) ); $code = cleanl( $_POST['code'] ); if($empty($name)){ $a = 1; }else { $a = 0; } if($empty($email)){ $b = 1; }else { $b = 0; } if($empty($message)){ $c = 1; }else { $c = 0; } if($empty($code)){ $d = 1; }else { $d = 0; } if($a == 1 || $b == 1 || $c == 1 || $d == 1){ $error = "The form has not been filled in correctly. Please make sure you have done the following things...<br /><br />- Filled in all of the fields<br />- Enter a valid email address<br />- Answered the security question correctly."; //form html removed } else { // film filled out, check it... if(validate_email($email)) { $pass = 0; } else { $pass = 1; } if($code == 4) { $assess = 0; } else { $assess = 1; } if($pass == 1 || $assess == 1) { $error = "The form has not been filled in correctly. Please make sure you have done the following things...<br /><br />- Filled in all of the fields<br />- Enter a valid email address<br />- Answered the security question correctly."; //form html removed } else { //form passes, send form... } } } If anyone could helo me out, thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/187673-function-name-must-be-a-string/ Share on other sites More sharing options...
oni-kun Posted January 8, 2010 Share Posted January 8, 2010 Which line is line 83?.. From what I browse through I don't see any errors. Quote Link to comment https://forums.phpfreaks.com/topic/187673-function-name-must-be-a-string/#findComment-990789 Share on other sites More sharing options...
sasa Posted January 8, 2010 Share Posted January 8, 2010 change line if($empty($name)){ to if(empty($name)){ rremove 1st $ Quote Link to comment https://forums.phpfreaks.com/topic/187673-function-name-must-be-a-string/#findComment-990797 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.