我不确定为什么这不起作用,它没有给我任何错误,但它不会显示结果。我只想显示 3 个文本字段的结果。我想做的下一步是将数据输入数据库,然后显示它,但我想接下来会出现。谢谢你。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
$Fname = $_POST["Fname"];
$Lname = $_POST["Lname"];
$Pword = $_POST["Pword"];
if (!isset($_POST['submit'])) { // if page is not
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<form method = "post" action = "<?php echo $PHP_SELF;?>">
First name<input name="Fname" type="text" maxlength="12"
/>
<br />
<br />
Last name<input name="Lname" type="text" maxlength="12"
/>
<br />
<br />
<!--Address <input name="register_address" type="text" maxlength="12"
/>
<br />
<br />-->
<!--<select name="state" value="State"></select>-->
Password<input name="Pword" type="text" maxlength="12"
/>
<br />
<br />
<!--Re-type Password<input name="register_password_confirm" type="text" maxlength="12"
/>
<br />
<br />-->
<input name="submit" type="button" value="Submit" />
</form>
<?
} else {
echo "Hello, ".$Fname." ".$Lname.".<br />";
echo "Your Password is, " .$Pword.".<br />";
}
?>
</body>
</html>