-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathgetdetails.php
46 lines (38 loc) · 924 Bytes
/
getdetails.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
<?php
/*
* @copyright (c) 2008 Nicolo John Davis
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
session_start();
if(!isset($_SESSION['isloggedin']))
{
echo "<meta http-equiv='Refresh' content='0; URL=login.php' />";
exit(0);
}
else
{
$username = $_SESSION['username'];
$userid = $_SESSION['userid'];
}
include('settings.php');
print <<<EOHTML
<ul class="sidemenu">
<li>
<div style='position: relative'><span>$username</span>
EOHTML;
$cn = mysql_connect('localhost', $DBUSER, $DBPASS);
mysql_select_db($DBNAME, $cn);
$query = "select score from users where id = $userid";
$result = mysql_query($query);
if($result)
{
$result = mysql_fetch_array($result);
$score = $result['score'];
print "<span style='position: absolute; right: 0px'>$score</span></div>";
}
mysql_close($cn);
print <<<EOHTML
</li>
</ul>
EOHTML;
?>