forked from yeghiakoronian/BuyACar-Ecommerce-Web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkUsername.php
72 lines (72 loc) · 1.09 KB
/
checkUsername.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
<?php
include 'core/init.php';
admin_protect();
?>
<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
$conn = mysql_connect("localhost","root","");
if(!$conn)
{
echo mysql_error();
}
$db = mysql_select_db("lr",$conn);
if(!$db)
{
echo mysql_error();
}
$username=$_POST['username'];
$q="SELECT * FROM users WHERE username='$username'";
$r = mysql_query("$q",$conn);
if($r)
{
while($row=mysql_fetch_array($r))
{
$fname=$row['first_name'];
$lname=$row['last_name'];
$email=$row['email'];
$trans=$row['transNumb'];
echo "<table border=1>";
echo "<tr>";
echo "<td>";
echo "username";
echo "</td>";
echo "<td>";
echo "first name";
echo "</td>";
echo "<td>";
echo "last name";
echo "</td>";
echo "<td>";
echo "email";
echo "</td>";
echo "<td>";
echo "number of transactions";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>";
echo $username;
echo "</td>";
echo "<td>";
echo $fname;
echo "</td>";
echo "<td>";
echo $lname;
echo "</td>";
echo "<td>";
echo $email;
echo "</td>";
echo "<td>";
echo $trans;
echo "</td>";
echo "</tr>";
echo "</table>";
}
}
else
{
echo mysql_error();
}
?>
<a href="adminUser.php">back</a>