Jump to content

Max Width Error Check


Wayniac

Recommended Posts

Hey all! I'm having a hard time understanding how one retrieves an images width that is about to be uploaded? I am just trying to give it a simple error check to say "keep under 500 pixels". Below is an if statement I threw together. Nothing is spit out and it uploads normally, even if I upload an image larger then 500 pixels width. It must be something with it not being declared properly.

 

if ($imageWidth > 500) {
echo "Error: Image width must be 500 pixels or less.";
exit();
}

Link to comment
https://forums.phpfreaks.com/topic/190435-max-width-error-check/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.