Jump to content

Big Favour, Checking a class


onlyican

Recommended Posts

Hey all
OPP to OOP
(soz wanted to say that for ages)

Anyway
I was building something to check, resize and upload images

I was doing it, then I thought, I would put each little bit into a function
So theres a function to check the image
There is a function to Get the new image width and height
There is a function to Resize and upload the image

Then I looked at it, and thought I would try and make it a class
THis is my first ever class
So I dont pick up bad habbits and keep doing things wrong, I wanted to ask the brains if they could take 3 mins to check it.
The phps file is here
http://onlyican.com/class_upload_img.phps
There is no php uploaded there

I have tested it on my local machine, and it works. It uploads the images I want
Fails on the images I dont want

Any problems u can see or anything, please let me know

I think I have covered every little bit on that code
Link to comment
Share on other sites

Just because your code is contined within a class does not mean it is OOP. Your class is fairly static and would be hard to make customizations to without going in and actually changing code.

For instance your $allowed_file_types array should probably be made into a property which could then be set from outside the class, instead of being built into it. Same with wanted height and width, which by the way is a complete misuse of constants.

There is plenty more we could go into, but these things might help you as a starting point.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.