Hi,
i am trying to learn PHP and no i have managed to create member system with memberlist with help. And now i want to add a function that allows members to edit their information.
I tried it with this code but it does not work at all:
please help me out a bit!
i am trying to learn PHP and no i have managed to create member system with memberlist with help. And now i want to add a function that allows members to edit their information.
I tried it with this code but it does not work at all:
please help me out a bit!
PHP:
<?php
session_start();
if (!empty($_POST[username]))
{
if ($_POST[password] != $_POST[password2])
exit("Error - Passwords don't match. Please go back and try again.");
require_once("connect.php");
$query = mysql_query("update set members
(province, kingdom, email, msn, password)
$affected_rows = $sql->id = $_SESSION[id];
VALUES (,'$_POST[province]','$_POST[kingdom]','$_POST[email]','$_POST[msn]','$_POST[password]')")
or die ("Error - Couldn't edit account.");
include("header.inc");
echo "You have succesfully edited your account!<br /><br />
Please login <a href='login.php'><b>here</b></a>.";
include("footer.inc");
exit();
}
?>
<?php include("header.inc"); ?> <form action="account.php" method="post">
<table width="75%" align="center" cellpadding="3" cellspacing="1" style="border: 5px solid #FFFFFF">
<tr>
<td width="100%" style="font-family: verdana; font-size: 10px"><b>edit your account</b></td>
</tr>
<tr>
<td width="100%" style="font-family: verdana; font-size: 10px"><label>Province Name: <br /><input type="text" name="province" size="20" value="<? echo $_POST[province]; ?>"></label></td>
</tr>
<tr>
<td width="100%" style="font-family: verdana; font-size: 10px"><label>Kingdom Coordinates: <br /><input type="text" name="kingdom" size="20" value="<? echo $_POST[kingdom]; ?>"></label></td>
</tr>
<tr>
<td width="100%" style="font-family: verdana; font-size: 10px"><label>Email: <br /><input type="text" name="email" size="20" value="<? echo $_POST[email]; ?>"></label></td>
</tr>
<tr>
<td width="100%" style="font-family: verdana; font-size: 10px"><label>MSN: <br /><input type="text" name="msn" size="20" value="<? echo $_POST[msn]; ?>"></label></td>
</tr>
<tr>
<td width="100%" style="font-family: verdana; font-size: 10px"><label>Password: <br /><input type="password" name="password" size="20" value="<? echo $_POST[password]; ?>"></label></td>
</tr>
<tr>
<td width="100%" style="font-family: verdana; font-size: 10px"><label>Verify Password: <br /><input type="password" name="password2" size="20" value=""></label></td>
</tr>
<tr>
<td width="100%" style="font-family: verdana; font-size: 10px"><input type="submit" value="Edit!"></td>
</tr>
</table>
</form>
<?php include("footer.inc"); ?>






