function checkInputs()
{
$fname = $_POST["fname"];
$lname = $_POST['lname'];
$email = $_POST['email'];
...
}
<form method = 'POST' action = 'index.php'>
First Name:<input type = 'text' name = 'fname'>
Last Name:<input type = 'text'name = 'lname'>
Email:<input type = 'text' name = 'email'>
</form>
在单击按钮之前不会调用该函数。
不管我是否尝试在页面加载后放置 php 标签,并且无论它仍然会产生错误 'Undefined index : ... at Line