Ich habe hier das Script das die Daten von einem Formular die dort eingegeben wurden, ändern soll, er ändert aber nichts. Kann mir da bitte jemand helfen???
<?php
session_start();
require_once('config.php');
$errmsg_arr = array();
$errflag = false;
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if(!$link) {
die('Failed to connect to server: ' . mysql_error());
}
$db = mysql_select_db(DB_DATABASE);
if(!$db) {
die("Unable to select database");
}
function post($str) {
$str = @trim($str);
if(get_magic_quotes_gpc()) {
$str = stripslashes($str);
}
return mysql_real_escape_string($str);
}
$member_id = ($_POST['member_id']);
$fname = ($_POST['fname']);
$lname = ($_POST['lname']);
$login = ($_POST['login']);
$password = ($_POST['password']);
$cpassword = ($_POST['cpassword']);
$email = ($_POST['email']);
$website = ($_POST['website']);
$ort = ($_POST['ort']);
if($fname == '') {
$errmsg_arr[] = 'First name missing';
$errflag = true;
}
if($lname == '') {
$errmsg_arr[] = 'Last name missing';
$errflag = true;
}
if($login == '') {
$errmsg_arr[] = 'Login ID missing';
$errflag = true;
}
if($password == '') {
$errmsg_arr[] = 'Password missing';
$errflag = true;
}
if($cpassword == '') {
$errmsg_arr[] = 'Confirm password missing';
$errflag = true;
}
if( strcmp($password, $cpassword) != 0 ) {
$errmsg_arr[] = 'Passwords do not match';
$errflag = true;
}
if($email == '') {
$errmsg_arr[] = 'Confirm email missing';
$errflag = true;
}
if($website == '') {
$errmsg_arr[] = 'Confirm website missing';
$errflag = true;
}
if($ort == '') {
$errmsg_arr[] = 'Confirm ort missing';
$errflag = true;
}
if($login != '') {
$qry = "SELECT * FROM members WHERE member_id='$member_id'";
$result = mysql_query($qry);
if($result) {
if(mysql_num_rows($result) > 0) {
$errmsg_arr[] = 'Login ID already in use';
$errflag = true;
}
@mysql_free_result($result);
}
else {
die("Query failed");
}
}
if($errflag) {
$_SESSION['ERRMSG_ARR'] = $errmsg_arr;
session_write_close();
header("location: profile-form.php");
exit();
}
$aendern = "UPDATE members SET fname = 'fname', lname = 'lname', login = '' WHERE member_id = ''";
$update = @mysql_query($qry);
if($result) {
header("location: aenderung-success.php");
exit();
}else {
die("Query failed");
}
?>