mxaksoy
Üyeliği Durdurulmuş
Banlı Kullanıcı
-
Üyelik
23.03.2018
-
Yaş/Cinsiyet
29 / E
-
Meslek
Webmaster
-
Konum
İstanbul Avrupa
-
Ad Soyad
M** A**
-
Mesajlar
1358
-
Beğeniler
482 / 344
-
Ticaret
3, (%100)
Arkadaşlar youtube scripti üzerinde çalışıyorum avatar bölümünde sıkıntım var. Kodlar doğru fakat sayfa yeniliyor.
$user_session_nickname = $_SESSION['user_session'];
$user_avatar = mysql_real_escape_string(strip_tags(trim($_POST['user_avatar']));
if($_FILES['file']['size'] == 0){
echo 'sismall';
}else if($_FILES['file']['size'] >= 5000){
echo 'sibig';
}else{
if(isset($_FILES['file'])){
$file_name = $_FILES['file']['name'];
if(!$file_name){ $file_name = $user_session_nickname.'-'.hash("sha256", $user_session_nickname."_".date("Ymd-Hi")."_".md5($user_session_nickname.'_'.date("Ymd-Hi"))); }
$file_size =$_FILES['file']['size'];
$file_tmp =$_FILES['file']['tmp_name'];
$file_type=$_FILES['file']['type'];
$file_ext=strtolower(end(explode('.',$_FILES['file']['name'])));
$path_parts = pathinfo($file_name);
$expensions= array("jpeg","jpg","png");
if(in_array($file_ext,$expensions)=== false){
$error= "extension";
}
$file = $user_session_nickname.'-'.hash("sha256", $user_session_nickname."_".date("Ymd-Hi")."_".md5($user_session_nickname.'_'.date("Ymd-Hi")));
move_uploaded_file($file_tmp,"uploads/".$file);
$dosya = 'uploads/'.$file;
$update = mysql_query("UPDATE sukelaci_user SET user_avatar = '$dosya' WHERE user_nickname = '$user_session_nickname'");
if($update){
echo 'success';
}else{
echo 'failed';
unlink($dosya);
}
}else{
if(!$user_avatar){
echo 'space';
}else{
$avatar_update_query = mysql_query("UPDATE sukelaci_user SET user_avatar = '$user_avatar' WHERE user_nickname = '$user_session_nickname'");
if($avatar_update_query){
echo 'success';
}else{
echo 'failed';
}
}
}
}