Siema, mam skrypt na edycje profilu :
<?php
include 'config.php';
require 'header.php';
db_connect();
check_login();
$user_data = get_user_data();
if(isset($_POST['email'])) {
$_POST['website'] = clear($_POST['website']);
$_POST['from'] = clear($_POST['from']);
$_POST['new_password'] = clear($_POST['new_password']);
$_POST['new_password2'] = clear($_POST['new_password2']);
$_POST['password'] = clear($_POST['password']);
$_POST['email'] = clear($_POST['email']);
$err = '';
$up2 = '';
if(!empty($_POST['new_password']) || $_POST['email'] != $user_data['email']) {
if(empty($_POST['password'])) { $err = '<p>Jeśli chcesz zmienić hasło lub adres email musisz podać aktualne hasło.</p>';
} elseif(($_POST['password']) != $user_data['pass']) {
$err = '<p>Podane aktualne hasło jest nieprawidłowe.</p>';
} else {
if(!empty($_POST['new_password'])) {
if($_POST['new_password'] != $_POST['new_password2']) {
$err = '<p>Podane hasła nie są takie same.</p>';
} else {
$up2.= ", `pass` = '".($_POST['new_password'])."'";
}
}
if($_POST['email'] != $user_data['email']) {
if(filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) === false) {
$err = '<p>Podany email jest nieprawidłowy.</p>';
} else {
$result = mysql_query("SELECT Count(uid) FROM `drift_gracze` WHERE `uid` != '{$user_data['user_id']}' AND `email` = '{$_POST['email']}'"); if($row[0] > 0) {
$err = '<p>Już istnieje użytkownik z takim loginem lub adresem e-mail.</p>';
} else {
$up2.= ", `email` = '{$_POST['email']}'";
}
}
}
}
}
} else {
$result = mysql_query("UPDATE `drift_gracze` SET `none` = '{$_POST['website']}', `none` = '{$_POST['from']}'{$up2} WHERE `uid` = '{$user_data['user_id']}'"); if($result) {
echo '<p>Twój profil został poprawnie zaktualizowany.</p>';
$user_data = get_user_data();
} else {
}
}
}
echo '<form method="post" action="editprofile.php"> <p>
Nowe hasło (pozostaw puste jeśli nie chcesz zmieniać):<br>
<input type="password" value="" name="new_password" autocomplete="off">
</p>
<p>
Powtórz nowe hasło:<br>
<input type="password" value="" name="new_password2" autocomplete="off">
</p>
<p>
E-mail:<br>
<input type="text" value="'.$user_data['email'].'" name="email">
</p>
<p>
Aktualne hasło (wymagane przy zmianie emaila lub hasła):<br>
<input type="password" value="" name="password" autocomplete="off">
</p>
<p>
<input type="submit" value="Edytuj profil">
</p>
</form>';
require 'footer.php';
db_close();
?>
Po wypełnieniu wszystkich pól wywala, że pomyślnie zmieniono, a w bazie nic się nie zmieniło, proszę o pomoc.