The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Image won't upload to database?! Reply To: Image won't upload to database?!


It looks like you actually removed the code that would make that possible…

getimagesize() as per the php documentation provides some basic information about the image being uploaded, such as the width and height.

From there it would be as simple as an if/else statement along the lines of:

if ( ($w == 1920 AND $h == 1080) OR ($w == 1280 AND $h == 720) ) {
    // good
} else {
    // bad

But note that the above is VERY rigid, and requires that the file be exactly those dimensions. If you wanted to suppose something less than or equal to you’d have to adjust your operators accordingly.