-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstu_registration.php
More file actions
39 lines (39 loc) · 1.21 KB
/
stu_registration.php
File metadata and controls
39 lines (39 loc) · 1.21 KB
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
36
37
38
39
<?php
//$con=mysqli_connect("sql113.ezyro.com","ezyro_28159409","z7n0ky94i","ezyro_28159409_ims");
$con=mysqli_connect("localhost","root","","braintech");
?>
<?php
$n=$_POST['n'];
$em=$_POST['em'];
$no=$_POST['no'];
$add=$_POST['add'];
$pwd=$_POST['pwd'];
$gen=$_POST['gen'];
$fname=$_FILES['pht']['name'];
$file_temp_loc =$_FILES['pht']['tmp_name'];
$file_store="upload/".$fname;
$c=mysqli_query($con,"select count(*) from student where email='$em'");
$cot=mysqli_fetch_array($c);
$val=$cot['count(*)'];
if($val>=1){
header("location:login.php?msg=present");
}
else{
move_uploaded_file($file_temp_loc,$file_store);
$s=mysqli_query($con,"insert into student(name,email,phone,address,pwd,photo,gender) values('$n','$em',$no,'$add','$pwd','$file_store','$gen')");
if($s==1)
{
$i=mysqli_query($con,"select id from student where email='$em'");
$a=mysqli_fetch_array($i);
$id=$a['id'];
$id=100+$id;
$uid="BTT/STU/".$id;
mysqli_query($con,"update student set stu_id='BTT/STU/$id' where email='$em'");
header("location:login.php?msg=done&id=$uid");
}
else
{
header("location:index.php?msg=not_done");
}
}
?>