Hi guys I have written a site in php where users signup and create their own profiles. They can add their own profile but when they have to login to update the profile I cant get that page to display their information so it can be updated. I have added the code below as I keep looking at it and cant find any problem please help me.
<?php
include "user.php";
include "../common.php";
$link = mysql_connect("$server", "$username", "$password")
or die("Could not connect");
mysql_select_db("$db") or die("Could not select database");
if (empty($page)) $page = "";
if ($page == "update") {
mysql_query("UPDATE escorts SET name='$name', email='$email', country='$country', location='$location', city='$city', rates='$rates', description='$description', height='$height', stats='$stats', age='$age' WHERE user = '$user'");
echo "Done updating";
} else {
$result = mysql_query("SELECT * FROM escorts WHERE user = '$user'");
while ($i = mysql_fetch_array($result)) { } }
echo "$i[name]";
echo "$i[email]";
echo "$i[country]";
echo "$i[location]";
?>
<center><a href="pic.php?user=<?php echo $user; ?>">Edit your picture</a></center>
<form action=index.php?user=<?php echo $user; ?>&page=update method=post enctype="post">
<table border=0 cellpadding=1 cellspacing=0 class="maintxt-highlite">
<tr>
<td>Name:<td><input type=text name=name maxlength="50" value="<?php echo $i[name]; ?>"></td>
</tr>
<tr>
<td>E-Mail:</td>
<td><input type=text name=email maxlength="70" value="<?php echo $i[email]; ?>"></td>
</tr>
<tr>
<td>Country:</td>
<td><input type=text name=country maxlength="99" value="<?php echo $i[country]; ?>"></td>
</tr>
<tr>
<td>Location:</td>
<td><input name=location type=text id="location" value="<?php echo $i[location]; ?>" maxlength="99"></td>
</tr>
<tr>
<td>City:</font></td>
<td><input type=text name=city maxlength="99" value="<?php echo $i[city]; ?>"></td>
</tr>
<tr>
<td>Height</font>:</td>
<td><input type=text name=height maxlength="20" value="<?php echo $i[height]; ?>">
</td>
</tr>
<tr>
<td>Stats</font>:</td>
<td>
<input type=text name=weight maxlength="20" value="<?php echo $i[stats]; ?>"></td>
</tr>
<tr>
<td>Age</font>:</td>
<td>
<input type=text name=age maxlength="5" value="<?php echo $i[age]; ?>"></td>
</tr>
<tr>
<td>Rates:</td>
<td><input type=text name=rates value="<?php echo $i[rates]; ?>"></td>
<tr>
<tr>
<td>Description</font>:</td>
<td>
<textarea cols=20 rows=4 name=description><?php echo $i[description]; ?></textarea></td>
</tr>
<tr colspan=2>
<td><input type=submit value="Update Your Page!">
</table>
</form>
</td>
</tr>
</table> </td>
</tr>
</table>
</body>
</html>