I would like to get my variable to enter into my text fields, so when a user edits thier profile, it displays what they already have. This is what I have, and it works, except for displaying variables into the text field. And at the very top, where it says Editing Profile for User: it is blank as well, it isnt reading the $username. 🙁
<? include('hiddencode.php'); ?>
<? include('top.php'); ?>
<?
include('dbinfo.inc.php');
$query = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password'") or die(mysql_error());
$res = mysql_num_rows($query);
$username = $row['username'];
$fname = $row['fname'];
$lname = $row['lname'];
$age = $row['age'];
$email = $row['email'];
$city = $row['city'];
$state = $row['state'];
$homepage = $row['homepage'];
$profile = $row['profile'];
if($res != "1") { ?>
<table width="129%" border="0" cellspacing="0" cellpadding="3" height="55%">
<tr>
<td height="248" valign="top" width="991">
<table width="85%" border="1" bordercolor="#000000" cellspacing="0" cellpadding="0" align="center" background="/images/turntable.jpg">
<tr>
<td height="475" width="100%" valign="center"> Your username or password
is unvalid. Please try again.</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td height="50" colspan="2">
<div align="right">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="/images/bar3.gif" height="21">
</td>
</tr>
</table>
<? } else { ?>
<table width="129%" border="0" cellspacing="0" cellpadding="3" height="55%">
<tr>
<td height="248" valign="top" width="991">
<table width="85%" border="1" bordercolor="#000000" cellspacing="0" cellpadding="0" align="center" background="/images/turntable.jpg">
<tr>
<td height="475" width="100%" valign="center"><font size="3" face="Tahoma"><strong>Editing
profile for user: <?= $username ?></strong></font> <br>
<form action="updateprofile.php" method="post" name="updateprofile" id="updateprofile">
<table width="75%" border="0">
<tr>
<td width="42%"><strong><font size="2" face="Tahoma">Password
Change:</font></strong></td>
<td width="58%"><input name="password" type="text" id="password" size="24" maxlength="24" style="background-color: transparent"></td>
</tr>
<tr>
<td><strong><font size="2" face="Tahoma">Confirm Password:</font></strong></td>
<td><input name="password2" type="text" id="password2" size="24" maxlength="24" style="background-color: transparent"></td>
</tr>
<tr>
<td><strong><font size="2" face="Tahoma">First Name:</font></strong></td>
<td><input name="fname" type="text" id="fname" size="24" maxlength="12" style="background-color: transparent" value=<?= $fname ?>></td>
</tr>
<tr>
<td><strong><font size="2" face="Tahoma">Last Name:</font></strong></td>
<td><input name="lname" type="text" id="lname" value="<?= $lname ?>" size="24" maxlength="12" style="background-color: transparent"></td>
</tr>
<tr>
<td><strong><font size="2" face="Tahoma">Age:</font></strong></td>
<td><input name="age" type="text" id="age" value="<?= $age ?>" size="24" maxlength="2" style="background-color: transparent"></td>
</tr>
<tr>
<td><strong><font size="2" face="Tahoma">Email:</font></strong></td>
<td><input name="email" type="text" id="email" value="<?= $email ?>" size="24" maxlength="30" style="background-color: transparent"></td>
</tr>
<tr>
<td><strong><font size="2" face="Tahoma">City:</font></strong></td>
<td><input name="city" type="text" id="city" value="<?= $city ?>" size="24" maxlength="18" style="background-color: transparent"></td>
</tr>
<tr>
<td><strong><font size="2" face="Tahoma">State:</font></strong></td>
<td><input name="state" type="text" id="state" value="<?= $state ?>" size="24" maxlength="2" style="background-color: transparent"></td>
</tr>
<tr>
<td><strong><font size="2" face="Tahoma">Homepage: (exclude
[url]http://[/url])</font></strong></td>
<td><input name="homepage" type="text" id="homepage" value="<?= $homepage ?>" size="24" maxlength="30" style="background-color: transparent"></td>
</tr>
<tr>
<td><strong><font size="2" face="Tahoma">Profile:</font></strong></td>
<td><textarea name="profile" cols="50" id="profile" style="background-color: transparent"><?= $profile ?></textarea></td>
</tr>
</table>
</form> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td height="50" colspan="2">
<div align="right">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="/images/bar3.gif" height="21">
</td>
</tr>
</table>
<? } ?>
<? include('bottom.php'); ?>
Thank you for any help you can offer.