Uploading a file in PHP5 works the same as uploading in PHP4 as long as you are aware that you should take in consideration the following points:
1- In a shared host the ideal value for openbase_dir is to be a dedicated path for every user or client.
So in the php.ini file openbase_dir = (/web/www.yourwebsite.com/).
You can add multiple paths : (/web/www.yourwebsite.com/:/tmp/).
This is to limit the files that can be opened by PHP to the specified directory.
2- Using a function such as: move_uploaded_file ( string $filename , string $destination )
Your destination should be an absolute path.
During the move a temporary directory is needed, this directory will be defined in php.ini under upload_tmp_dir, if there is no value by default the directory will be /tmp.
3- Many shared host company leave openbase_dir with no value this will not cause any problem if upload_tmp_dir have no value as well, but if there is the values should be:
openbase_dir = /web/www.yourwebsite.com/:/tmp/
upload_tmp_dir = /tmp/
This changes can be done by the host provider as its not possible to use function ini_set() or .htaccess file to change the value of a php_admin_value.
1- In a shared host the ideal value for openbase_dir is to be a dedicated path for every user or client.
So in the php.ini file openbase_dir = (/web/www.yourwebsite.com/).
You can add multiple paths : (/web/www.yourwebsite.com/:/tmp/).
This is to limit the files that can be opened by PHP to the specified directory.
2- Using a function such as: move_uploaded_file ( string $filename , string $destination )
Your destination should be an absolute path.
During the move a temporary directory is needed, this directory will be defined in php.ini under upload_tmp_dir, if there is no value by default the directory will be /tmp.
3- Many shared host company leave openbase_dir with no value this will not cause any problem if upload_tmp_dir have no value as well, but if there is the values should be:
openbase_dir = /web/www.yourwebsite.com/:/tmp/
upload_tmp_dir = /tmp/
This changes can be done by the host provider as its not possible to use function ini_set() or .htaccess file to change the value of a php_admin_value.