Quote from: sixthcrusifix on January 18, 2006, 11:01:42 PMQuote from: x on January 18, 2006, 09:53:03 PM
for 1. and 2. use getimagesize. (www.php.net/getimagesize) have them upload the file, do the check, if it's too big or if it's not got the right type, delete it.
but if they upload a massive photo, you could just have the script resize the photo and crop it a bit
oooh I see cool. But what about image type? should I just use preg_match in teh filename?
it's on that page as well. the function returns $width, $height, $type, $attr
QuoteIndex 0 contains the width of the image in pixels. Index 1 contains the height. Index 2 is a flag indicating the type of the image: 1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(intel byte order), 8 = TIFF(motorola byte order), 9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13 = SWC, 14 = IFF, 15 = WBMP, 16 = XBM.
so you just do a wee if statement and check for the number above