-
Notifications
You must be signed in to change notification settings - Fork 0
/
farm-reg-process.php
executable file
·35 lines (31 loc) · 1.09 KB
/
farm-reg-process.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
$con = mysqli_connect('localhost','root','','student') or die("could not connect");
if(isset($_POST['save'])){
// if(getimagesize($FILES['image']['tmp_name'])==FALSE)
// {
// echo "check file...";
move_uploaded_file($_FILES['image']['tmp_name'], "uploads/" . $_FILES['image']['name']);
$f="uploads/". $_FILES['image']['name'];
$fname=$_POST['fname'];
$surname=$_POST['surname'];
$gender=$_POST['gender'];
$qualification=$_POST['qualification'];
$contact=$_POST['contact'];
$address=$_POST['address'];
$checkbox=$_POST['crops'];
$employ=$_POST['employ'];
$str1="";
for($i=0;$i<$checkbox;$i++)
{
$str1 = $str1 . " ";
}
//$sql1="INSERT INTO register(Image,Fname,Surname,Gender,Qualification,Contact,EmploymentStatus,Address,Crops) VALUES('$f','$fname','$surname','$gender','$qualification','$contact',$employ','$address','$str1')";
echo "$qualification";
$query=mysqli_query($con,"insert into register values('$f','$fname','$surname','$gender','$qualification','$contact','$employ','$address','$str1')");
if($query){
echo "insertedd";
}else{
echo "not inserted" ;
}
}
?>