Re: PHP Profile Pages
Posted: Sat Dec 06, 2008 2:13 pm
Ok the member list page isCirdan wrote:After you get a list of usernames from the databse, you just loop through the rows that you retrieved and do something like:
echo "<a href='profile.php?user=".$username."'>" .$username."</a>"
which would turn into
<a href='profile.php?user=CoolDude101'>CoolDude101</a>
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Profile</title>
</head>
<body>
<?php
include ('database.php');
$result = mysql_query("SELECT * FROM `Persons`;") or die(mysql_error());
$num_rows = mysql_num_rows($result);
print "There are $num_rows records.<P>";
print "<table width=200 border=1>\n";
while ($get_info = mysql_fetch_row($result)){
print "<tr>\n";
foreach ($get_info as $field)
print "\t<td><font face=arial size=1/>$field</font></td>\n";
print "</tr>\n";
}
print "</table>\n";
mysql_close($link);
?>
</body>
</html>