-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.php
80 lines (59 loc) · 2.72 KB
/
client.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Revolutionary life - Living Stones</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Registration Website">
<meta name="author" content="Samuel Thampy">
<!-- Le styles -->
<link href="css/bootstrap.css" rel="stylesheet">
<style>
</style>
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="../assets/js/html5shiv.js"></script>
<![endif]-->
<script src="js/jquery-2.1.0.min.js"></script>
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="../assets/ico/favicon.png">
</head>
<body>
<!-------------------------------------------------------------------------
1) Create some html content that can be accessed by jquery
-------------------------------------------------------------------------->
<div id="total"> </div>
<script id="source" language="javascript" type="text/javascript">
var getData = function() {
//-----------------------------------------------------------------------
$.ajax({
url: 'api.php', //the script to call to get data
data: "", //you can insert url argumnets here to pass to api.php
//for example "id=5&parent=6"
dataType: 'json', //data format
success: function(data) //on recieve of reply
{
$.each(data,function(index,item){
$('#total').append("<b>id: </b>"+item.User_id +"<b> name: </b>"+item.firstname+"</br>"); //Set output element html
});
//recommend reading up on jquery selectors they are awesome
// http://api.jquery.com/category/selectors/
}
});
};
$(document).ready(function() {
$(function ()
setInterval(getData, 1);
});
{
//-----------------------------------------------------------------------
// 2) Send a http request with AJAX http://api.jquery.com/jQuery.ajax/
});
</script>
</body>
</html>