我已经检查了我的代码一千次了,但是它从没有弹出,所以我尝试了一个PHP Checker / Tester。它告诉我/home4/phptest/public_html/code.php70(5)中未定义函数test_input()的调用:eval()的代码:4堆栈跟踪:#0 /home4/phptest/public_html/code.php70(5 ):eval()#1 {main}抛出在第4行,这是什么意思?请帮忙!
<?php
($_SERVER["REQUEST_METHOD"] == "GET");
$charName = test_input($_GET["charName"]);
$charType = test_input($_GET["charType"]);
$healthTokens = test_input($_GET["healthTokens"]);
$expTokens = test_input($_GET["expTokens"]);
$supplyTokens = test_input($_GET["supplyTokens"]);
$charName = $_POST['charName'];
$charType = $_POST['charType'];
$healthTokens = $_POST['healthTokens'];
$expTokens = $_POST['expTokens'];
$supplyTokens = $_POST['supplyTokens'];
if (strtolower($password) == "php123")
{
$goldSpent = $healthTokens / 10 + $expTokens / 2 + $supplyTokens / 25;
print("<h1>You have created $charName the $charType!</h1>");
print("<p>$charName has $healthTokens health tokens,
$expTokens experience tokens, and
$supplyTokens supply tokens.</p>");
print("<p>$charName has spent $goldSpent gold pieces.</p>");
}
else
{
print ("<p>Sorry! That password is NOT correct. Please try again</p>");
}
?>
答案 0 :(得分:0)
您调用未在代码中定义的函数:
$ charName = 测试输入($ _ GET [“ charName”]);
该功能可以在脚本中未包含的另一个文件中定义。