I am trying to submit data from an HTML form to PHP to be saved into mysql database. I had previously done this and for some reason it cannot work, I must be missing something.
This is Register page
<form action="reg.php" method="POST">
<table >
<tr>
<td>Email :</td>
<td><input name="Email" type="text" /></td>
</tr>
<tr>
<td>Password :</td>
<td><input name="Password" type="password" /></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="submit" value="Submit"> </td>
</tr>
</table>
</form>
This is the reg.php
<?php
include_once("db.php");
$SQL = "INSERT INTO users (Email, Password ) VALUES ('".$_GET["Email"]."','". $_GET['Password'] ."' )";
mysql_query($SQL);
error_reporting(E_ALL);
?>
And this is the db.php
<?php
$MyUsername = "root";
$MyPassword = "";
$MyHostname = "localhost";
$dbh = mysql_pconnect($MyHostname , $MyUsername, $MyPassword);
$selected = mysql_select_db("dbName",$dbh);
?>
If I run
localhost/reg.php?Email=email@gmail.com&Password=123456
It does work and those values are shown in the database, I must be missing something in the register page.
It could be a stupid mistake as Im new to PHP.
Thanks in advance