You are on page 1of 1

<?

php
include("connection.php");
error_reporting(0);
?>
<form action="form.php" method="get">
<label>FIRST NAME :</label>
<input type="text" name="fname"id="fname" placeholder="ENTER YOUR FIRST NAME"><br>
<label>LAST NAME :</label>
<input type="text" name="lname" id="lname" placeholder="ENTER YOUR LAST NAME"><br>
<label>FATHER NAME :</label>
<input type="text" name="fatname"id="fatname" placeholder="ENTER YOUR FATHER
NAME"><br>
<label>E-MAIL :</LAST>
<input type="email"name="email"id="email"><br>
<label>password</label>
<input type="paasword" name="pass"id="pass"><br>
<input type="submit" name="submit" value="submit">
</form>
<?php
if ($_GET['submit'])
{
$fn=$_GET['fname'];
$ln=$_GET['lname'];
$fat=$_GET['fatname'];
$em=$_GET['email'];
$ps=$_GET['pass'];
if($fn!="" && $ln!="" && $fat!="" && $em!="" && $ps!="" )
{
$query="INSERT INTO STUDENT VALUES('$fn','$ln','$fat','$em','$ps')";
$data=mysql_query($conn,$query);
if($data)
{
echo "Data insert into Database sucessfully...";
}
}
else
{
echo "All field are required";
}
}
echo $fn;
echo $ln;
echo $fat;
echo $em;
echo $ps;
?>

You might also like