I found that I was including the wrong file. whopps.
But now my records are not updating. Can someone have a look for me. I think it may because I have been changing $auth and $data around in my code. I have tried restoring but still not updating.
This is the code that gets submitted on submit:
case"Update":
if ($firstname && $lastname && $email) {
# $auth=$auth;
$data=$HTTP_POST_VARS;
$auth[login]=$auth[login];
update_member($data, "member");
$content="success.php";
} else {$error="80";}
This is what happens in update_member:
function update_member ($data, $user) {
global $db_name, $tbl_member;
if ($user == "admin") {
$oldpassword = mysql_result(mysql_db_query($db_name, "SELECT password FROM $tbl_member WHERE login='$auth[login]'"),0);
if ($oldpassword == $auth[password]) {$password="";}
else {$password="password='$auth[password]', ";}
# else {$password="password='".crypt($auth[password], $auth[login])."', ";}
$active="active='$auth[active]', ";
}
$query = "UPDATE $tbl_member SET $active $password ";
$query.= "firstname='$data[firstname]', lastname='$data[lastname]', email='$data[email]', ";
$query.= "occupation=$data[occupation], organization='$data[organization]', gender='$data[gender]', ";
$query.= "birthdate='$data[tahun]-$data[bulan]-$data[tanggal]', city='$data[city]', ";
$query.= "zipcode='$data[zipcode]', state='$data[state]', country='$data[country]', website='$data[website]', ";
$query.= "phone='$data[phone]', address='$data[address]' ";
$query.= "WHERE login='$auth[login]'";
$hasil=mysql_db_query($db_name, $query) or die (mysql_error());
return $auth[error];
My fields in my edit form all have this in the value respectivly:
<?echo $auth[something]?>
is there a problem in any of this code?
Thanks for help.