Jump to content

Problem with filter_var


coldfiretech

Recommended Posts

Im having some problems with this invite form..  i keep getting this error

Fatal error: Call to undefined function: filter_var() in /home/cellsav/public_html/invite.php on line 6

 

here is the code

<?php
function spamcheck()
  {

  $invite = $_POST['iemail'];
  if(filter_var($invite, FILTER_VALIDATE_EMAIL))
{
return TRUE;
}
else
{
return FALSE;
}

  }
  // end of function

  if (isset($_REQUEST['iemail']))
  {
  $mailcheck = spamcheck();
  if ($mailcheck==FALSE)
    {
    echo "Invalid input";
    }
  else
    {//send email
    $email = $_REQUEST['iemail'] ; 
    $subject = $_REQUEST["You've been invited to Cell Savior!"] ;
    $message = $_REQUEST['message'] ;
    mail($email, "Subject: $subject",
    $message, "From: Cell Savior" );
    echo "Thank you for using our invite system!";
    }
  }
else
  //redirect back to contact form
  echo "Please enter an email address in the form before submitting.";
?>

 

Link to comment
https://forums.phpfreaks.com/topic/120811-problem-with-filter_var/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.