i'm trying to learn php but i ran into this problem
search.php
<form action="process.php" method=get>
Choose Search Type:<br>
<select name="searchtype">
<option value="steamid">SteamID
<option value="alias">Alias
</select>
<br>
Enter Query:<br>
<input name="searchquery" type="text">
<br>
<input type="submit" value="Search">
</form>
process.php
<html>
<body>
Result<br><br>
<?php
trim($GET['searchquery']);
if (!$GET['searchtype'] || !$_GET['searchquery'])
{
echo "You have not enter search detail";
exit;
}
$searchtype = addslashes($GET['searchtype']);
$searchquery = addslashes($GET['searchquery']);
@ $db = mysql_pconnect("localhost", "user", "password");
if (!db)
{
echo "Error: could not open database";
exit;
}
mysql_select_db("steamid");
$query = "select * from globaliddb_ids, globaliddb_names where ".$searchtype." like '%".$searchquery."%'";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);
for ($i=0; $i < $num_results; $i++)
{
$row = mysql_fetch_array($result);
echo ($i+1)." SteamID: ";
echo htmlspecialchars( stripslashes($row["GlobalID"]));
echo "<br>Name: ";
echo htmlspecialchars( stripslashes($row["Name"]));
echo "<br>";
}
?>
</body>
</html>
Am I missing something?