我正在尝试创建一个登录凭据表。我有一个登录按钮,它接受用户名和密码,并且能够通过 POST 发送它们。我想在 html 表格中显示信息。我的 index.html 看起来像这样:
<html><head>
<title>Login</title>
</head>
<body style="left:-1px; top:-2px; " >
<form action="index.html" method="post" >
Email<input type="email" name="data" value="" />
Password<input type="text" name="pass" value="" />
<input type="submit" />
<?php
$index = 0;
$credentials = array{usernames,};
if (isset($_POST['submit']) { //to check if the form was submitted
$username= $_POST['data'];
$password= $_Post['pass'];
//$result = array($username,$password);
$credentials['usernames'].append($username);
$credentials['passwords'].append($password);
}
?>
</form>
<table>
<tbody><tr><th>Usernames</th>
<th>Passwords</th>
<?php for($i = 0; $i < $credentials.length; $i++){ <tr><?php echo $credentials[i]?></tr><tr><?php echo $credentials[password[i]]?></tr><tr>
</body><html>
我究竟做错了什么?