-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapply.php
67 lines (41 loc) · 990 Bytes
/
apply.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
session_start();
if(!isset($_SESSION['id']))
{
header("location:login.php?task=PlseLogin");
}
else{
include 'includes/header_student.inc.php';
include 'src/php/dbh.php';
$first_name=" ";
$last_name=" ";
$email=" ";
$contact=" ";
}
$id=$_SESSION['id'];
$sql="SELECT * FROM student_register WHERE id=$id";
$res = mysqli_query($conn,$sql);
if($res){
while($row=mysqli_fetch_assoc($res)){
$first_name=$row['first_name'];
$last_name=$row['last_name'];
$email=$row['email'];
$contact=$row['contact'];
}
}
else
{
echo "Error";
}
$accepted = 0;
$sql1="INSERT INTO `applied_internship`(`student_uid`, `student_firstname`, `student_lastname`, `student_email`, `student_phoneno`,`accepted`) VALUES ('$id','$first_name','$last_name','$email','$contact','$accepted')";
$res=mysqli_query($conn,$sql1);
if($res){
header("location:applied.php?task=successful");
}
else
{
header("location:applied.php?task=unsuccessful");
}
?>
?>