-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.php
54 lines (47 loc) · 1.38 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
<?php
//start session
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Login for Linkedin API using PHP</title>
<link rel="stylesheet" href="css/style.css"/>
</head>
<body style="background-color: pink">
<?php
if(isset($_SESSION["loggedin_user_id"]) && !empty($_SESSION["user"])) /* use this Session value for changing header after successful getting data*/
{
$user = $_SESSION["user"];
?>
<div class="login-form">
<div class="head">
<img src="<?php echo $user->pictureUrl; ?>" alt=""/>
</div>
<form>
<li>
<p><?php echo $user->formattedName; ?></p>
</li>
<li>
<p><?php echo $user->emailAddress; ?></p>
</li>
<li>
<p><?php echo $user->location->name; ?></p>
</li>
<div class="p-container">
<a href="logout.php" class="logout">Logout</a>
<a href="<?php echo $user->publicProfileUrl; ?>" target="_blank" class="profile">View Profile</a>
<div class="clear"> </div>
</div>
</form>
</div>
<?php
}else{
if(isset($_SESSION["err_msg"]) && $_SESSION["err_msg"] <> ""){
echo $_SESSION["err_msg"];
}
echo '<div class="linkedin_btn"><a href="process.php"><img src="images/sign-in-with-linkedin.png" /></a></div>';
}
?>
</body>
</html>