-
Notifications
You must be signed in to change notification settings - Fork 0
/
updtpro.php
74 lines (72 loc) · 2.17 KB
/
updtpro.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
68
69
70
71
72
73
74
<?php
include("logic/connection.php");
include("logic/back.php");
$idd=$_SESSION['id'];
$query3=mysqli_query($con,"select * from student where myid='$idd'");
while($result=mysqli_fetch_assoc($query3)){
$name=$result['name'];
$number=$result['number'];
$dob=$result['dateofbirth'];
$clgid=$result['college'];
}
?>
<form action="" method="post">
<table border="2">
<tr>
<td>
name
</td>
<td>
<input type="text" value="<?php echo $name;?>" name="name" id="name" required>
</td>
</tr>
<tr>
<td>
photo
</td>
<td>
<img src="student/<?php echo $idd;?>/student_pic.png" style="height:100px;width:100px;" name="photo" id="photo">
<form action="" method="post">
<input type="submit" value="delete" name="submit">
</form>
</td>
</tr>
<tr>
<td>
phone number
</td>
<td>
<input type="text" value="<?php echo $number;?>" name="number" id="number" required>
</td>
</tr>
<tr>
<td>
date of birth
</td>
<td>
<input type="date" value="<?php echo $dob;?>" name="dob" id="dob" required>
</td>
</tr>
<tr>
<td>
<input type="submit" value="submit" name="submit">
</td>
</tr>
</table>
</form>
<?php
if(isset($_POST['submit'])){
$nm=$_REQUEST['name'];
$num=$_REQUEST['number'];
$dob=$_REQUEST['dob'];
date_default_timezone_set("asia/kolkata");
$datetime = date('d/m/Y h:i:s a', time());
$query4=mysqli_query($con,"INSERT INTO `request` (`sid`, `stud_id`,`clgid`, `name`, `number`, `dateofbirth`, `status`,`reqdate`) VALUES (NULL, '$idd','$clgid', '$nm', '$num', '$dob', '1','$datetime'); ");
?>
<script>
alert("update successfully")
document.location="profile.php";
</script>
<?php
}
?>