View Single Post
Old 06-08-2010, 03:48 PM   #4 (permalink)
delayedinsanity
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

Let's clean up the code a little before we start narrowing down where the issue is - I noticed you are using getimagesize() to find the dimensions of the image, but you're using a custom function to determine the file type.

Never trust a file extension to be what it says it is. I could easily rename an executable to dot jpg and trick your script into believing it was an image - getimagesize will attempt to return the correct mime-type for the file that has been uploaded if your expecting only images. The other option would be <a href="http://us3.php.net/manual/en/ref.fileinfo.php">FileInfo</a> but I don't see any reason you wouldn't be just fine using getimagesize.

I'm not seeing the JavaScript that VI is mentioning but maybe I missed something there; outside of that, zomg, I haven't seen the CENTER element since Netscape.
delayedinsanity is offline  
Reply With Quote