Hello I am having some trouble inserting my form information onto my database. I am recieving the connected to database echo however when click on submit i get a 404 error. Any help would be greatly appreciated. Thank you in advance!
<?php
$host="localhost";
$dbuser="root";
$pass="******";
$dbname="learn";
$con = mysqli_connect ($host, $dbuser, $pass, $dbname);
if (mysqli_connect_errno ())
{
die ("Connection Failed!" . mysqli_connect_error());
}
else
{
echo "Connected to database {$dbname} ";
}
if(isset($_POST['submit']))
{
$fname=$_POST ['fname'];
$lname=$_POST ['lname'];
$email=$_POST ['email'];
$pswrd=$_POST ['pswrd'];
$sql = $con->query ("INSERT INTO users ( fname, lname, email, pswrd,)
VALUES ( ' {$fname} ' , ' {$lname} ' , ' {$email} ' , ' {$pswrd} ' , ')" );
}
?>
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Signup</title>
<meta charset="utf-8">
<meta name="description" content="description of webpage">
<meta name="keywords" content="keywords go here">
<meta name="author" content="me">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/signup.css">
<link rel="index" href="index.php">
<link rel="icon" href="img/favicon.png" sizes="16x16" type="image/png">
</head>
<body>
<div class="header">
<div id="logo">
<a href="index.php"><img src="img/logo.png" alt="logo" title="learnlogo"/></a>
</div>
</div>
<div id="signupform">
<form action="submit" method="post"><br>
<input type="text" name="fname" placeholder="First name">
<input type="text" name="lname" placeholder="Last name"><br><br>
<input type="text" name="email" placeholder="Email address">
<input type="password" name="pswrd" placeholder="Password"><br><br>
<input type"submit" value="Submit">
</form>
</div>
<?php
include ("inc/footer.php");
?>