upload photo limits


Posted on 16th Feb 2014 07:03 pm by admin

ive got a upload photo script and im just trying to make more secure currently it limits size and as you can see from my code below it limits only gif and php files

how do i edit my code to limit all these or do i have to copy and paste the same code and change the file extention?
jpg, jpeg, pjpeg, PJPEG, JPG, JPEG, gif, GIF, png, PNG

Code: if (!($uploaded_type=="image/gif")) {
echo "You may only upload GIF files.
";
$ok=0;
}

also ive restricted php is there anything else i need to restrict?
Code: if ($uploaded_type =="text/php")
{
echo "No PHP files
";
$ok=0;
}

No comments posted yet

Your Answer:

Login to answer
284 Like 33 Dislike
Previous forums Next forums
Other forums

Basic Forum Tutorial
Hi, I'm new to PHP. I want to build a basic forum for my site using PHP and MySQL. I've searched t

Compare user input to flat file data
Help...Am a complete newbie to programming so my code is prolly quite long. Am trying to verify a us

Transaction variant for VA02 not working
My requirement is to have transaction for user to only add the output and print a sales order.

DOMDocument
Hello All,

I need to take an XML document, modify some of the nodes in it and then perform a

Reditecting pages based on logic
Newbie here, apologies in advance!

I am trying to use the header function to forward one of a

Accessing element of object array
Hello

My object looks like this:


Array ( [0] => User Object ( [id] =>

How to get exact 3 moths post date from today date using javascript
How to get exact 3 moths post date from today date using javascript
Please help

Pls help with PHP
Pls can anyone direct me on how to create a user account for a customer. For example i want know if

quick basic question, hopefully not dumb
I don't know how to search for this, so forgive me if it's been covered...

I often see an exa

sql error
I have been looking at this code for 20mins and can't work out what I am doing wrong. There is somet

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash