-----------------------Insert data-------------------------
<?php
include("db.php");
error_reporting(0);
if(isset($_REQUEST['submit']))
{
$name=$_REQUEST['name'];
$fathername=$_REQUEST['fathername'];
$mothername=$_REQUEST['mothername'];
$cource=$_REQUEST['cource'];
$email=$_REQUEST['email'];
$password=$_REQUEST['password'];
$phone=$_REQUEST['phone'];
$img=$_FILES['img']['name'];
$location="upload/".$img;
copy($_FILES['img']['tmp_name'],$location);
$dob=$_REQUEST['dob'];
$gender=$_REQUEST['gender'];
$address=$_REQUEST['address'];
$query="insert into studentregister(`name`,`fathername`,`mothername`,`cource`,`img`,`email`,`password`,`phone`,`dob`,`gender`,`address`)
values('$name','$fathername','$mothername','$cource','$img','$email','$password','$phone','$dob','$gender','$address')";
$result = mysqli_query($conn,$query);
if($result)
{
echo '<div class="alert alert-success">Form Submitted Successfully</div>';
}
else{
echo '<div class="alert alert-danger">Error Something Went Erong</div>';
}
}
?>
0 Comments