I am trying to create a simple login program but the data is not going to phpMyAdmin.
I am using wamp server for phpmyadmin & have database named 'firstdatabase' and table named 'reg'.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<h1 align="center">Registration</h1>
<form action="" method="get">
<table width="261" border="1" align="center">
<tr>
<td width="85">ID : </td>
<td width="160"><label>
<input name="id" type="text" id="id" />
</label></td>
</tr>
<tr>
<td>Password :</td>
<td><label>
<input name="pass" type="password" id="pass" />
</label></td>
</tr>
<tr>
<td>Email ID : </td>
<td><label>
<input name="email" type="text" id="email" />
</label></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="Submit" value="Submit" />
</div></td>
</tr>
</table>
<label></label>
</form>
</body>
</html>
<?php
if ( $_POST )
{
$con=mysqli_connect('localhost','root','','firstdatabase');
if (!$con)
{
echo"Connected to server...";
}
$id=$_POST['user_id'];
$pass=$_POST['user_name'];
$email=$_POST['user_email'];
$query = "
INSERT INTO `firstdatabase`.`reg` (`user_id`, `user_pass`, 'user_email') VALUES ('$id', '$pass', '$email')";
mysql_query($query);
echo "<h2>Thank you for your registering!</h2>";
mysql_close($con);
}
?>