【发布时间】:2018-09-09 04:12:15
【问题描述】:
我想在 html 和 php 中打印出用户名、密码、电子邮件、名字和姓氏。但是,它不工作,而不是运行代码,它只是打印出代码代码。
这是SignUp.html的代码:
<!DOCTYPE html>
<html>
<body>
<script src="index.js"></script>
<h1 class="hg">Get Started</h1>
<form action="SignUpPhpTest.php" method="get" class="signup-form" >
FirstName: <input type="firstname" name="firstname">
Lastname: <input type="lastname" name="lastname">
Email: <input type="text" name="mail" id="mail">
Username: <input type="text" name="Username" id="Username">
<label>
Password: <input type="password" name="password" id="password" type="password" onkeyup='check();'>
</label>
<label>
Confirm Password: <input type="password" name="confirm_password" id="confirm_password" onkeyup='check();'>
<span id='message'></span>
</label>
<input type="submit" action="SignUp.php" value="submit">
</form>
<h2 class="GenderHeading">Gender</h2>
<form class="Gender">
<input type="radio" name="gender" value="male">Male
<input type="radio" name="gender" value="Female">Female
<input type="submit" value="submit">
</form>
</body>
<link href="index.css" rel="stylesheet" type="text/css" />
</html>
请注意,这将保存为.html 文件。这是SignUpTest.php 文件的代码:
<!DOCTYPE html>
<html>
<head>
<p>Info Gathered</p>
</head>
<body>
<table>
<tr>
<td>
<?php
$firstname = $_POST['fistname'];
$lastname = $_POST['lastname'];
$email = $_POST['mail'];
$username = $_POST['username'];
$password = $_POST['password'];
echo $firstname;
?>
</td>
<td>
<?php echo $lastname; ?>
</td>
<td>
<?php echo $email; ?>
</td>
<td>
<?php echo $username; ?>
</td>
<td>
<?php echo $password; ?>
</td>
</tr>
</table>
</body>
</html>
请不要将此保存为.php 文件。所有这些都在记事本中。我有 Windows 10。
感谢任何帮助。谢谢!!!
【问题讨论】:
-
您使用的是哪种网络服务器?浏览器无法解释 PHP。
标签: php