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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.