This is my index.php page:
<html>
<body>
<form action="action.php" method="post">
Username: <input type="text" name"username"><br />
Password: <input type="password" name="password">
<input type="submit" name="submit" />
</form>
</body>
</html>
This is my action.php page:
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("users", $con);
mysql_query("INSERT INTO userlogin (username, password)
VALUES ('username', 'password')");
mysql_close($con);
?>
Here's the problem:
Everytime the users clicks submit the action.php page insert username and password into my table instead of the username and password the user types in. It just put username under the colum username and password under the column password!
I don't understand what I did wrong!