To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
Code CritiqueHaving someone critique your code is always a great way to hone the skills. Stop in and post your code to see what your peers may have done differently.
Attached is a file that contains the code to resize an image to a thumbnail. I did this up in tutorial format because I couldn't find a good tutorial on the subject. Here it is for comment, critique and dismemberment.
[EDIT]
Updated the script with a bug fix and the changes suggested by moonglobe.
[/EDIT]
Maybe you should add an automatic folder creator within it. I had an error thinking it would work first time. But other than that its not bad at all. Though i suggest you use move_uploaded_file instead of copy because some systems have safe mode on. But im sure this wont be used as anything else but just test and learning experience..
Originally posted by planetsim Though i suggest you use move_uploaded_file instead of copy because some systems have safe mode on. But im sure this wont be used as anything else but just test and learning experience..
Nice stuff
Are you actually allowed to upload files when safe mode is on?
KITTfan2K just to answer your question, ive used move_uploaded_file many times on safe mode, i actually work with my current settings with safe_mode = on, just because of the restrictions it gives. The only way that move_uploaded_file will not work is if the function was disabled, other than that it works practically the just about the same other than it works in safe mode regardless
i dont see how..... and if it does its more infinitismal than the differene between ' and " for most things. however if you can use E_ALL and have no errors on a production box, you have some pretty solid code.
(of course noone should be displaying errors, only logging them for production)
__________________
there's no place i can be, since i found serenity.
I do my absolute best to generate no errors in production code. My errors in production code are emailed to a mailbox that is linked to my beeper so my beeper goes off every time one of my production sites generates an error. That's what I call motivation to not generate errors.