-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcharacter_search.php
74 lines (71 loc) · 1.51 KB
/
character_search.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
<?php
include "db-config.php";
include "menu.php";
include "character_menu.php";
$Databases=mysql_select_db("$Characters", $connect);
if (!$Databases)
{
echo "Can't connect to the database characters!";
header("location:Connect.php");
}
?>
<script type="text/javascript" src="character_search.js"></script>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form_ins" onsubmit="return search(this)">
<input type="hidden" name="x">
<table>
<tr>
<td>Guid</td>
<td>Account</td>
<td>Name</td>
</tr>
<tr>
<td><input type="text" name="guid" style="width:125px;"></td>
<td><input type="text" name="account"></td>
<td><input type="text" name="name"></td>
<td><input type="submit" value="Search"></td>
</tr>
</table>
<div class="scroll">
<table border="1">
<tr>
<td>Guid</td>
<td>Account</td>
<td>Name</td>
<td>Class</td>
<td>Race</td>
<td></td>
</tr>
<?php
$guid=$_POST['guid'];
$account=$_POST['account'];
$name=$_POST['name'];
$x=$_POST['x'];
$where="WHERE 1=1";
if ($guid)
{
$where.=" AND guid=$guid";
}
if ($account)
{
$where.=" AND account=$account";
}
if ($name)
{
$where.=" AND name=$name";
}
$query=mysql_query("SELECT * FROM characters $where");
while ($row=mysql_fetch_array($query) AND $x==1)
{
echo "<tr>
<td>{$row['guid']}</td>
<td>".htmlspecialchars($row['account'])."</td>
<td>".htmlspecialchars($row['name'])."</td>
<td>".htmlspecialchars($row['class'])."</td>
<td>".htmlspecialchars($row['race'])."</td>
<td><a href=\"characters.php?guid={$row['guid']}\">Edit</a></td>
</tr>";
}
?>
</table>
</div>
</form>