-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
70 lines (51 loc) · 1.93 KB
/
index.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
<?php
session_start();
?>
<?php
if(isset($_POST['submit'])){
include 'data1.php';
function test($data){
$data=stripslashes($data);
$data=htmlspecialchars($data);
return $data;
}
$name=$username=$mobile=$age=$branch=$interests="";
if($_SERVER["REQUEST_METHOD"]=="POST"){
$name= test($_POST["name"]);
$username= test($_POST["user"]);
$mobile= test($_POST["mobile"]);
$age= test($_POST["age"]);
$branch= test($_POST["branch"]);
$interests= test($_POST["interests"]);
$email= $_POST["email"];
}
data($name, $username, $mobile, $age, $branch, $interests, $email);
if($age){
header("Location: profile.php");
}
else{
echo "Age is a compulsory feed";
}
}
?>
<html>
<head>
<title>Complete Profile</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="sign.js"></script>
</head>
<body>
<h1>User Profile</h1>
<form method="post" action="index.php">
<li><input type="email" id="email" name="email" class="input" value= <?php echo $_SESSION["email"]; ?> readonly></li>
<li><input type="text" id="name" name="name" class="input" value=<?php echo $_SESSION["name"]; ?> onchange="nameval()" required></li>
<li><input type="text" id="username" name="user" class="input" value= <?php echo $_SESSION["username"]; ?> onchange="userval()" required></li>
<li><input type="text" id="mobile" name="mobile" class="input" value= <?php echo $_SESSION["mobile"]; ?> onchange="mobiles()" required="required"></li>
<li><input type="number" id="age" name="age" class="input" placeholder="Enter age" required="required">
<li><input type="text" id="branch" name="branch" class="input" placeholder="Enter branch(optional)"></li>
<li><input type="text" id="interests" name="interests" class="input" placeholder="Enter your interests(optional)"></li><br>
<li><input type="submit" value="submit" name="submit"><br><br>
<li><a href="logout.php">Logout</a>
</form>
</body>
</html>