I would like to know if its possible to set a timelimit/timeout to a script in php..
ex: I have a script to update my avatar, and I would like to know if it's possible when a user tries to insert a LARGE file, if it's taking too long, show an message or redirect to another page saying try to insert an smaller file
There are config settings for PHP that measure the file size: max_file_upload max_upload_size
Update those to the maximum file size you'll accept and then PHP will do the rest.
you can use the PHP function set_time_limit($seconds)