-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser_dashboard.php
More file actions
83 lines (69 loc) · 1.45 KB
/
user_dashboard.php
File metadata and controls
83 lines (69 loc) · 1.45 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
<?php
session_start();
?>
<html>
<head>
<title>Test Page</title>
<script src="includes/js/jquery-1.10.1.min.js"></script>
<link rel="stylesheet" href="includes/css/bootstrap.css">
<style>
body
{
margin: 5px;
}
</style>
</head>
<body>
<!-- Test Links. Can be changed accordingly -->
<!-- 'a' tags -->
<a href="1.html" id="link1">1</a>
<br>
<a href="2.html" id="link2">2</a>
<br>
<a href="3.html" id="link3">3</a>
<br>
<a href="4.html" id="link4">4</a>
<br>
<a href="5.html" id="link5">5</a>
<!-- 'div' -->
<div id="div1">
<p id="p1">Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum </p>
</div>
<div id="div2">
<h1 id="heading">Hello! How are you</h1>
</div>
<br>
<br>
<!-- Images -->
<img src="http://placehold.it/350x150" id="image">
<br>
<br>
<script>
$(document).ready(function () {
$(document).on('click', function(e) {
e.preventDefault(); //stop any default actions
var id=e.target.id; //retrieve element id that has been clicked
var element=e.target.tagName;
if(element=='A')
{
var path=document.getElementById(id).getAttribute('href');
}
var URL = window.location.pathname; //retrieve URL of page without domain
//sending data to store.php to store in a file
$.ajax({
type: "POST",
url: "store.php",
data: "id="+id+"&url="+URL,
success: function(msg)
{
if(element=='A')
{
window.location=path;
}
}
});
});
});
</script>
</body>
</html>