Jump to content

[SOLVED] Call to undefined function filter_input()...


christofurr

Recommended Posts

Why do I get the error?

 

<html>
<body>

<p>

<form action="form4.php" method="post">
Full Name: <input type="text" name="name" value="<?php echo $_POST["name"]; ?>" size="35" 

maxlength="35" />
Email Address: <input type="text" name="email" value="<?php echo $_POST["email"]; ?>" size="35" 

maxlength="50" />
<input type="submit" value="Create Account" />
</form>

</p>

<p>

Your name is <?php echo $_POST["name"]; ?>. <br />
Your email address is <?php echo $_POST["email"]; ?>. <br />

</p>

<p>

<?php 
if (!filter_input(INPUT_POST, "email", FILTER_VALIDATE_EMAIL))
{
echo "Invalid email address.<br />";
}
if (!ereg('([a-zA-Z0-9]+[:space:]*){3,32}', $_POST["name"]))
{
echo "Invalid characters in Full Name field.";
}
elseif (ereg('^[:space:]+', $_POST["name"]))
{
echo "Full Name cannot begin with a space.";
}
elseif (ereg('[:space:]+&', $_POST["name"]))
{
echo "Full Name cannot end with a space.";
}
else
{
echo "Your Full Name is " . $_POST["name"];
}

?>

</p>

</body>
</html>

I'm still confused. What must I do in order for the code to work?

 

Read any simple tutorial on functions.

 

How can your function call possibly work when there is absolutely no code anywhere to explain what filter_input is supposed to do?

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.