Im kind of new to html and wanted to do a simple program where i store users login information in an associative array, basically using it as a database. In my code i was able to get the array to store information but it will only store one set of username and password. Heres the code:
<!DOCTYPE HTML>
<html>
<head>
<title>Login Form</title>
</head>
<body>
<form action="process.php" method="POST">
Username: <input type="text" name="username" id="username" />
Password: <input type="password" name="password" id="password" />
<input type="submit" value="Login" name="submit" />
</form>
</body>
</html>
<?php
$name = $_POST['username'];
$pass = $_POST['password'];
echo "<table border=1>";
foreach($name as $key => $n){
echo "<tr><td>$name[$key]</td><td>$pass[$key]</td></tr>";
}
echo "</table>";
?>