Jump to content

Need to make script less CPU-intensive... Can you have a look at it?


furnace

Recommended Posts

Hi everyone, first post - so welcome to me :D

 

I've written a script that will deal with a maximum of 15 uploaded images. If the script recieves more, it won't run - the sending page only has the ability to send up to 15, so if it recieves more it must be coming from elsewhere. It will only allow JPEG, GIF, BMP and PNG images too, with a filesize of around 1.1MB.

 

It's going to run on shared hosting, and might become a well used feature of the site, so I'm trying to keep CPU useage down to a minimum whilst keeping it secure.

 

Here is the script - you might want to paste it in to your preferred IDE as I couldn't get pastebin's syntax highlighting to do its job properly!

 

http://www.pastebin.cz/show/3258

 

Is there anything there that could be made faster? Is the script generally OK or do I need to do things better? I'm a self-taught php programmer and I always wonder if I'm doing things the "correct" way.

 

Anyways, any help on this script would be really appreciated :) Thanks in advance!

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.