小编pra*_*kur的帖子

PHP致命错误:在第11行的C:\ wamp\www\web \new9.php中调用未定义的函数test_input()

如果我们只输入名称并提交,则以下表单显示单击提交按钮时出错.显示的错误是

致命错误:在第11行的C:\ wamp\www\web \new9.php中调用未定义的函数test_input()

任何人都可以在下面的代码中找到问题.

      <?php
// define variables and set to empty values
$name1Err = $email1Err  =  "";
$name1 = $email1 =  "";

if ($_SERVER["REQUEST_METHOD"] == "POST")
{
 if (empty($_POST["input_1"]))
    {$name1Err = "Your name is required. Just the first will do. ";}
  else
    {$name1 = test_input($_POST["input_1"]);
     if (!preg_match("/^[a-zA-Z ]*$/",$name1))
       {       $name1Err = "Only letters and white space allowed"; }
    }

 if (empty($_POST["input_12"]))
    {$email1= "";}
  else
    {$email1 = test_input($_POST["input_12"]);
    // check if e-mail address syntax is valid
     if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/",$email1))
       { …
Run Code Online (Sandbox Code Playgroud)

html php error-handling if-statement function

1
推荐指数
1
解决办法
2万
查看次数

标签 统计

error-handling ×1

function ×1

html ×1

if-statement ×1

php ×1