I have the following code that inserts in my DB a name and city using PHP.
<?php
$link = mysqli_connect("localhost", "root", "admin");
mysqli_select_db($link, "crud");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<form name="form1" action="" method="post">
<table>
<tr>
<td>Insira o Nome</td>
<td><input type="text" name="t1"</td>
</tr>
<tr>
<td>Insira a Cidade</td>
<td><input type="text" name="t2"</td>
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" name="submit1" value="Cadastrar"></td>
</tr>
</table>
</form>
<?php
if(isset($_POST["submit1"]))
{
mysqli_query($link, "INSERT INTO table1 values('$_POST[t1]', '$_POST[t2]')");
}
?>
</body>
</html>
Every time I try to insert, I get the "404" error in my browser.