Komut sunucu bilgisayarda çalışır ama?

0 Cevap

Garip bir sorun ... Bu benim sunucuda çalışmıyor neden hiçbir fikrim yok.

Nedense IF adlı çalışmıyor.

Bana şaşırtıcı bir majör şu dosya uzantısını denetler biridir. O onun benim sunucu ve benim bilgisayarda DOĞRU dönen nedense uyuşmuyor bile.

    if (isset($_POST['submit'])) {

    $sizelimit = 50; //File size limit in KB.
    $destination_folder = 'images/user_avatars/temp/';

    $fileurl = $_POST['avatar_url'];
    $filetype = substr(strrchr($fileurl,'.'),1);
    $filename = "user_" . $_SESSION[user_id] . "." . $filetype;

    $temp = $destination_folder . $filename;

    if ($filetype == "gif" || "png" || "jpg" || "jpeg") {

        $file = fopen ($url, "rb");
        if ($file) {
            $newfile = fopen ($temp, "wb");
            if ($newfile) {
                while(!feof($file)) {
                    fwrite($newfile, fread($file, 1024 * 8 ), 1024 * 8 );
                }
            }
        }

        if ( filesize($temp) > 1024 * $sizelimit ) {
            $errors .= "The file size of the image you entered is too large!";
        }
    } else {
        $errors .= "The URL you entered is not a valid image!";
    }

    if (isset($errors)) {
        $smarty->assign("error_message", $errors);
        unlink($temp);
    } else {
        $avatar_sql = "
            UPDATE
                users
            SET
                user_avatar = '$filename'
            WHERE
                user_id = '$_SESSION[user_id]'
        ";
        $avatar_query = @mysqli_query ($db_connect, $avatar_sql);

        fclose($file);
        fclose($newfile);
    }
}

0 Cevap