Sorry. I had copied the wrong code. If you can edit this for me that would be great.
Thanks.
Code:
PHP Code:
<title>Welcome. <?php $logged[username]; ?></title><?php
ob_start();
include("config.php");
if ($logged[username])
{
// the user is logged in! We continue...
if (!$_POST[update])
{
// the form hasn't been submitted. We continue...
$profile = mysql_query("SELECT * from family_users where username = '$logged[username]'");
$profile = mysql_fetch_array($profile);
// the above lines get the information so that it can be displayed in the html form.
echo("
<center><form method=\"POST\">
<table width=\"100%\">
<tr>
<td align=\"right\" width=\"25%\">
Username
</td>
<td align=\"left\">
<input disabled=\"disabled\" type=\"text\" size=\"25\" maxlength=\"25\" name=\"locate\" value=\"$profile[username]\"></td>
</tr>
<tr>
<td align=\"right\" width=\"25%\">
Last Name
</td>
<td align=\"left\">
<input size=\"25\" name=\"msn\" value=\"$profile[lname]\"></td>
</tr>
<tr>
<td align=\"right\" width=\"25%\">
First Name</td>
<td align=\"left\">
<input size=\"25\" name=\"aim\" value=\"$profile[fname]\"></td>
</tr>
<tr>
<td align=\"right\" width=\"25%\">
Email Address</td>
<td align=\"left\">
<input size=\"25\" name=\"email\" value=\"$profile[email]\"></td>
</tr>
<tr>
<td align=\"right\" width=\"25%\">
Kids:
</td>
<td align=\"left\">
<input size=\"25\" name=\"kids1\" value=\"$profile[kids1]\"></td>
</tr>
<tr>
<td align=\"right\" width=\"25%\">
</td>
<td align=\"left\">
<input size=\"25\" name=\"kids2\" value=\"$profile[kids2]\"></td>
</tr>
<tr>
<td align=\"right\" width=\"25%\">
</td>
<td align=\"left\">
<input size=\"25\" name=\"kids3\" value=\"$profile[kids3]\"></td>
</tr>
<tr>
<td align=\"right\" width=\"25%\">
</td>
<td align=\"left\">
<input size=\"25\" name=\"kids4\" value=\"$profile[kids4]\"></td>
</tr>
<tr>
<td align=\"right\" width=\"25%\">
</td>
<td align=\"left\">
<input size=\"25\" name=\"kids5\" value=\"$profile[kids5]\"></td>
</tr>
<tr>
<td align=\"right\" width=\"25%\">
</td>
<td align=\"left\">
<input size=\"25\" name=\"kids6\" value=\"$profile[kids6]\"></td>
</tr>
<tr>
<td align=\"right\" width=\"25%\">
</td>
<td align=\"left\">
<input size=\"25\" name=\"kids7\" value=\"$profile[kids7]\"></td>
</tr>
<tr>
<td align=\"center\">
</td>
<td align=\"left\">
<input type=\"submit\" name=\"update\" value=\"Update\"></td>
</tr>
</table>
</form>
</center>");
}
else
{
$email = htmlspecialchars($_POST[email]);
$fname = htmlspecialchars($_POST[fname]);
$lname = htmlspecialchars($_POST[lname]);
$username = htmlspecialchars($_POST[username]);
$kids1 = htmlspecialchars($_POST[kids1]);
$kids2 = htmlspecialchars($_POST[kids2]);
$kids3 = htmlspecialchars($_POST[kids3]);
$kids4 = htmlspecialchars($_POST[kids4]);
$kids5 = htmlspecialchars($_POST[kids5]);
$kids6 = htmlspecialchars($_POST[kids6]);
$kids7 = htmlspecialchars($_POST[kids7]);
// the above lines get rid of all html.
echo ("Your profile has been updated!");
$update = mysql_query("Update family_users set
email = '$email',
lname = '$lname',
fname = '$fname',
kids1 = '$kids1',
kids2 = '$kids2',
kids3 = '$kids3',
kids4 = '$kids4',
kids5 = '$kids5',
kids6 = '$kids6',
kids7 = '$kids7',
username = '$logged[username]'
where username = '$logged[username]'");
// updates the information in the database.
}
}
else
{
// They aren't logged in!
echo ("<a href=\"login.php\">You must login</a>");
}
?>