I'm sure this must be a basic question but I'm still getting familiar with all this PHP stuff.
Basically, what I am looking to do is to put together an image file-upload system which has a limit on the height and width that the user can upload.
I have followed along with all the info contained at the W3schools site:
PHP File Upload
I understand that I will have to create my own function for this, but I don't quite know how to go about doing it.
I found some sites that seem to have a solution, but they don't seem to be geared to my level of beginner.
For instance - I found a site that seemed to describe how to do this (PHP Upload Images), but I do not understand these lines:
$my_uploader->max_image_size(150, 150); // max_image_size($width, $height)
/**
* void max_image_size ( int width, int height );
*
* Sets the maximum pixel dimensions. Will only be checked if the
* uploaded file is an image
*
* @param width (int) maximum pixel width of image uploads
* @param height (int) maximum pixel height of image uploads
*
*/
function max_image_size($width, $height){
$this->max_image_width = (int) $width;
$this->max_image_height = (int) $height;
}
If somebody could tell me briefly what I would need to add to the info from W3 in order to set this upload restriction, I would really appreciate it.
Conceptually, I understand what needs to be done: compare the width and height of the uploaded image to pre-defined variables, but I do not know how to execute this.
Any help is appreciated.


Sign In
Create Account

Back to top









