The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Shouldnt this be echoing something different?
allenph
post Feb 23 2012, 12:29 AM
Post #1


Novice
**

Group: Members
Posts: 21
Joined: 15-February 12
Member No.: 16,477



I know I post a thousand threads sorry... so my issue is...

<?php
$uploaded_boolean = file_exists($_FILES["uploaded_avatar"]["…
$gif = '.gif';
$jpg = '.jpg';
$jpeg = '.jpeg';
$png = '.png';
$jpeg1 = 'jpeg';
$gif1 = 'gif';
$jpg1 = 'jpg';
$png1 = 'png';
$max_file_size = '1048576';
$new_avatar = $_FILES['uploaded_avatar']['name'];
$avatar_ext = end(explode('.', $new_avatar));
if (isset($_POST['change_submit1'])) {
if ($_SESSION['logged_in'] != '1') {
echo 'You need to be logged in!';
} elseif ($_POST['change_box1'] != 'CHANGE') {
echo 'You must fill in the "CHANGE" box!';
} elseif ($uploaded_boolean == False) {
echo 'No file selected!';
} elseif (($avatar_ext != $jpg1) && ($avatar_ext != $png1) && ($avatar_ext != $gif1) && ($avatar_ext != $jpeg1)) {
echo 'File format not supported!';
} elseif ($_FILES["uploaded_avatar"]["size"] > $max_file_size) {
echo 'File is too big!';
}
}
?>

It seems like it would work...but it outputs no file selected even though I want it to say File format not supported. They are in the correct order. am i checking for the file upload incorrectly or something? help please!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 27th April 2024 - 04:50 AM