divinedesigns1 Posted October 13, 2015 Share Posted October 13, 2015 ok im having this issue with the format that is in an array() when comparing it to the $_FILES type $allowed = array('png', 'jpg', 'jpeg', 'gif');if($ptype != $allowed){ $errors[] = 'This format isnt allow</br>Accepted formats are as followed: PNG, JPG, JPEG, GIF';} when i try to upload a .tiff, .doc, .txt file it still upload but once i upload the correct file it displays the error message any tips, hint, advice on how i can go about fixing this? Link to comment Share on other sites More sharing options...
Ingolme Posted October 13, 2015 Share Posted October 13, 2015 $ptype is never equal to $allowed because one is a string and one is an array (or so I assume). In what part of the code is $ptype being set? If you want to check that a value exists in an array, then use in_array(). Link to comment Share on other sites More sharing options...
Ingolme Posted October 13, 2015 Share Posted October 13, 2015 You already made a topic for this: http://w3schools.invisionzone.com/index.php?showtopic=54131 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now