-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.php
executable file
·58 lines (46 loc) · 1.85 KB
/
profile.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
<?php
session_start();
$connect=mysqli_connect("localhost","root","","stockregister");
if(isset($_SESSION['user_id']) && !empty($_SESSION['user_id'])){
if(!$connect)
die(mysqli_error($connect));
$user_id=$_SESSION['user_id'];
if($user_id=='gopiprasanth'){
echo "<html>";
echo "<body>";
echo "<h3 class='blue-text'>MY PROFILE</h3>";
echo "<p class='violet-text'>USER ID:gopiprasanth</p><br>";
echo "<p class='indigo-text'>FIRST NAME:gopiprasanth</p><br>";
echo "<p class='black-text'>LAST NAME: potipireddy</p><br>";
echo "<p class='green-text'>ADDRESS:vizianagaram</p><br>";
echo "<p class='yellow-text'>PRIMARY CONTACT:8498011066</p><br>";
echo "<p class='orange-text'>SECONDARY CONTACT:9493005178</p><br>";
echo "<p class='red-text'>USER TYPE:admin</p><br>";
echo "<p class='blue-text'>EMAIL ID:[email protected]</p><br>";
echo "</body>";
echo "</html>";
}
else {
$user_details="SELECT * FROM user_details WHERE `user_id`='$user_id'";
$result=mysqli_query($connect,$user_details);
$row=mysqli_fetch_assoc($result);
echo "<html>";
echo "<h3 class='blue-text'>MY PROFILE</h3>";
echo "<p>USER ID:".$row['user_id']."</p><br>";
echo "<p>PASSWORD :".$row['password']."</p><br>";
echo "<p>FIRST NAME:".$row['first_name']."</p><br>";
echo "<p>LAST NAME".$row['last_name']."</p><br>";
echo "<p>ADDRESS".$row['address']."</p><br>";
echo "<p>PRIMARY COMTACT:".$row['primary_phone_number']."</p><br>";
echo "<p>SECONDARY CONTACT:".$row['secondary_phone_number']."</p><br>";
echo "<p>USER TYPE:".$row['user_type']."</p><br>";
echo "<p>EMAIL ID:".$row['email']."</p><br>";
echo "</html>";
echo "NOTE:for any changes or the content is wrong please visit the admin";
}
}
else {
echo "<script> alert('log in to view profile')</script>";
echo "<script>window.open('index.html','_self')</script>";
}
?>