hi
im currently working on a php script. here is the code where the error lies...
if (!isset($mode))
include ("panel.inc");
elseif($mode=="edit") {
if ($submit) {
$sql = "UPDATE users SET first='$first',last='$last',address='$address',city='$city',state='$state',postcode='$postcode' WHERE cusername=$PHP_AUTH_USER");
$result = mysql_query($sql);
echo "Information updated successfully!\n";
include ("header.inc");
echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
echo "<tr><td><center><img src=\"images/edit_title.gif\"></center>\n";
echo "</td></tr><tr><td>\n";
echo "<center><font face=\"$font_type\" size=\"3\"> </font><font face=\"$font_type\" size=\"1\"><br>\n";
echo "</font>\n";
echo "<table width=\"96%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
echo "<tr><td><font face=\"$font_type\" size=\"2\">Below are your current details, modify them as you wish. Once you have finished,\n";
echo " click modify at the bottom!<br> <br> \n";
echo "</font></td></tr></table></center></td></tr></table><br>\n";
include ("edit_form.inc");
include ("footer.inc");
} else {
include ("header.inc");
echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
echo "<tr><td><center><img src=\"images/edit_title.gif\"></center>\n";
echo "</td></tr><tr><td>\n";
echo "<center><font face=\"$font_type\" size=\"3\"> </font><font face=\"$font_type\" size=\"1\"><br>\n";
echo "</font>\n";
echo "<table width=\"96%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
echo "<tr><td><font face=\"$font_type\" size=\"2\">Below are your current details, modify them as you wish. Once you have finished,\n";
echo " click modify at the bottom!<br> <br> \n";
echo "</font></td></tr></table></center></td></tr></table><br>\n";
include ("edit_form.inc");
include ("footer.inc"); }
}
?>
Anyway, when the user goes to index.php?mode=edit, they get a form which shows the users information in text fields (from the mysql database). The user can then modify this information and once he/she has finished modifying, they click "modify". Once they click modify, their information is supposed to be updated.
However, this is what happens...
when they click MODIFY, the success message comes up saying "Information updated successfully!" however, nothing is actually updated.
can anyone help me?
Thanks!
Khilan