So I've been trying to create a simple HTML form that will submit user information to a local MYSQL database. When I try to run it I get "Cannot POST /test/addperson.php". I've tried many other solutions posted around but none of them seem to work.
HTML
<!DOCTYPE html>
<html>
<body>
<h2>User Database</h2>
<br>
<form action="test/addperson.php" method="post">
<p>First Name: </p>
<input type="text" name="first_name">
<p>Last Name: </p>
<input type="text" name="last_name"><br>
<input type="submit" name="submit">
</form>
</body>
</html>
PHP
<?php
$connect = mysql_connect("localhost:3306","root", "password");
if(!connect){
die('Connection Failed: ' . mysql_error());
}
mysql_select_db("Users", $connect);
$user_info = "INSERT INTO employees (first_name, last_name) VALUES ('$_POST[first_name]', '$_POST[last_name]')";
if(!sql_query($user_info, $connect)){
die('Error' . mysql_error());
}
echo "Your information was added to the database.";
mysql_close($connect);
?>