Jump to content

Fatal error: Call to undefined function?


DarkxPunk
 Share

Recommended Posts

Here is the error:

Fatal error: Call to undefined function: filter_var() in \\boswinfs02\home\users\web\b2680\ez.barfuturian2006\beta\index-5.php on line 102

Here is the PHP:

	<?php	 function spamcheck($field) {	  $field=filter_var($field, FILTER_SANITIZE_EMAIL);	  if(filter_var($field, FILTER_VALIDATE_EMAIL)) {	   return TRUE;	  }	  else {	   return FALSE;	  }	 }	 if (isset($_REQUEST['contact'])) {	  $mailcheck = spamcheck($_REQUEST['contact']);	  if ($mailcheck==FALSE) {	   echo "<form method='post' action='/index-5.php'><cite>E-Mail Address:</cite><br /><input name='contact' type='text' size='30px' /><br /><cite>Subject:</cite><br /><input name='subject' type='text' size='30px' /><br /><cite>Your Message:</cite><br /><textarea name='message' rows='10' cols='30'></textarea><br /><input type='submit' /></form>";	  }	  else {	   $email = $_REQUEST['contact'] ;	   $subject = $_REQUEST['subject'] ;	   $message = $_REQUEST['message'] ;	   mail("michaelasnape@me.com", "Subject: $subject",$message, "From: $email" );	   echo "Thank you for your interest, we will be in contact soon.";	  }	 }	 else {	  echo "<form method='post' action='/index-5.php'>E-Mail Address:<br /><input name='contact' type='text' size='30px' /><br />Subject:<br /><input name='subject' type='text' size='30px' /><br />Your Message:<br /><textarea name='message' rows='10' cols='30'></textarea><br /><input type='submit' /></form>";	 }	?>

I have used this code before... Never a error like this. Where is my error?

Link to comment
Share on other sites

Filter is not enable in your serve probably. Check your phpinfo()

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...