-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwelcome.php
More file actions
86 lines (79 loc) · 1.81 KB
/
Copy pathwelcome.php
File metadata and controls
86 lines (79 loc) · 1.81 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
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
75
76
77
78
79
80
81
82
83
84
<?php
session_start();
require "connection.php";
?>
<!DOCTYPE html>
<html>
<head>
<title>Home Page</title>
<link rel="stylesheet" type="text/css" href="styling.css">
</head>
<body>
<center>
<h1><b>Home Page</b></h1>
<?php
$sql="SELECT * FROM user";
//TO SHOW NAME OF USER WHEN HOME PAGE LOADS
$result=mysqli_query($conn,$sql);
if(mysqli_num_rows($result)>0)
{
while($row=mysqli_fetch_assoc($result))
{
if(($row["email"]==$_SESSION["email"]))
{
echo "<b>WELCOME ".$row[firstname]." ".$row[lastname]."</b>";
}
}
}
?>
<div>
<form action="welcome.php" method="post">
<h2>Please fill out the profile form</h2>
<h3>Username: <?php echo $_SESSION['email']; ?></h3>
Birthday:<br>
<input type="date" name="bday" required/>
<br><br>
Gender:<br>
Male<input type="radio" name="gender" value="male"/>
Female<input type="radio" name="gender" value="female"/>
Other<input type="radio" name="gender" value="Other"/>
<br><br>
Mobile No.:<br>
<input type="int" name="mob"required/>
<br><br>
Address:<br>
<textarea name="address">
</textarea>
<br><br>
<input name="save" type="submit" value="save">
<br><br>
<a href="signin.php">Log Out</a>
<br><br>
</form>
</div>
</center>
<?php
if(isset($_POST["save"]))
{
$birthday=$_POST["bday"];
$gender=$_POST["gender"];
$mob=$_POST["mob"];
$addd=$_POST["address"];
$em=$_SESSION["email"];
//INSERTING VALUE IN PROFILE TABLE
$sql="INSERT INTO profile (birthday, gender, mob, address, email) VALUES ('$birthday','$gender','$mob','$addd', '$em')";
if(mysqli_query($conn,$sql)){
echo " ";
}
else
{
echo " ". mysqli_error($conn);
}
}
mysqli_close($conn);
?>
<div class="footer">
<p>Created by @mahimakdn and @ayushimaheshwari98</p>
</div>
</body>
</html>