【发布时间】:2016-05-17 11:52:13
【问题描述】:
我在尝试回显玩家姓名时遇到致命错误。
我对 PHP 还是很陌生,这可能是菜鸟的错误,但我什么都试过了。
这是我的代码:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>A1S | e-tracker</title>
<link rel="stylesheet" href="css/menu.css">
<link rel="author" href="humans.txt">
</head>
<body>
<form action="#" method="get">
Name: <input type="text" placeholder="Player Full Name" name="pFullname"><br>
Date of Birth: <input type="date" name="pDob"><br>
Weight: <input type="number" name="pWeight" placeholder="Pounds" min="0"><br>
Height: <input type="number" name="pHeight" placeholder="Centimeters" min="0"><br>
<input type="submit">
<?php
$playerName = $_GET['pFullName'];
echo $playerName;
?>
</form>
<script src="script.js"></script>
</body>
</html>
任何帮助将不胜感激,谢谢!
【问题讨论】:
-
您需要提交表单并将您的PHP代码放在
form之外。 -
“我遇到了一个致命错误” - 我在您的帖子中看不到任何错误消息。