-
Notifications
You must be signed in to change notification settings - Fork 0
/
userdata.php
43 lines (39 loc) · 1.3 KB
/
userdata.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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Contents-Type" conten="text/html;charset=UTF-8">
<title> User Data </title>
</head>
<body>
<center>
<font size='10'> Your   Data<br><br> </font>
<?php
session_start();
$dbname = "User";
$link = mysql_connect( "localhost", "team2", "testpassjhkkrokw" );
if( !$link )
die( "Connection Failed.".mysql_error() );
$dbselect = mysql_select_db( $dbname, $link );
if( !$dbselect )
die( "DB Select Failed.".mysql_error() );
$chartype = mysql_query( "SET NAMES utf8", $link );
if( !$chartype )
die( "Query Failed.".mysql_error() );
$query = "SELECT * from ".$dbname.".Data where id = ".$_SESSION["id"].";";
$result = mysql_query( $query );
if( !$result )
die( "Query Failed.".mysql_error() );
$data = mysql_fetch_assoc( $result );
echo "<table><tbody><tr>";
echo "<th>Your Name</th>";
echo "<th>".$data["name"]."</th>";
echo "</tr>";
echo "<tr>";
echo "<th>Your Location</th>";
echo "<th>".$data["location"]."</th>";
echo "</tr></tbody></table><br><br>";
?>
<font size='5'> <a href="logout.php"> logout<br> </a> </font>
</center>
</body>
</html>