Example #1
0
?>
's profile</title>
	<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>

<body>

<h1><?php 
echo $user['displayName'];
?>
's profile</h1>

<ul>
	<li>Location: <?php 
echo $user['location'];
?>
</li>
	<li>Platforms: <?php 
echo decode_platformList($user['platformList']);
?>
</li>
	<li>Games: <?php 
echo $user['gameList'];
?>
</li>
</ul>

<a href="./home.php">Return to home</a><br />

</body>
</html>
Example #2
0
<?php 
$searchName = mysql_real_escape_string($searchName);
$games = mysql_real_escape_string($games);
$location = mysql_real_escape_string($location);
if ($searchName == '' && $games == '' && $location == '') {
    //no specifications, send back to search form
    header('Location: search.php');
}
$results = mysql_query("SELECT * FROM users WHERE displayName LIKE '%{$searchName}%' AND gameList LIKE '%{$games}%' AND location LIKE '%{$location}%'");
$i = 0;
while ($i < 50 && ($row = mysql_fetch_assoc($results))) {
    $i++;
    $loginName = $row['loginName'];
    $name = $row['displayName'];
    $games = $row['gameList'];
    $platformList = decode_platformList($row['platformList']);
    $location = $row['location'];
    $link = "./profile.php?user={$loginName}";
    echo "<li><a href=\"{$link}\">{$name}</a> is in {$location}, plays {$games}, and owns these platforms: {$platformList}</li>";
}
echo '</ol>';
if ($i == 0) {
    echo 'No results.<br />';
} else {
    if ($i == 50) {
        echo 'More than 50 results for this search. Only the first 50 are displayed.<br />';
    }
}
?>
<a href="./search.php">Search again</a><br />