I have a form to enter data into a mySQL database located in the /html/admin directory. This directory is password-protected.
The form allows to upload files which end up in the /html/admin/uploads directory.
I would like the files to actually be uploaded in another directory, /html/shop_images since these files will be used on public web pages but there seems to be a problem with permissions, I get the following error:
Warning: move_uploaded_file(): open_basedir restriction in effect. File(/html/shop_images/dieux41.jpg) is not within the allowed path(s): (/var/www/web13/html/:/var/www/web13/phptmp/:/var/www/web13/files/:/var/www/web13/atd/) in /var/www/web13/html/admin/shop_created.php on line 17
Here's the PHP code that processes the upload:
$target_path = "/html/shop_images/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
$photo = basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path))
{
echo "Le fichier ". basename( $_FILES['uploadedfile']['name']). " a été téléchargé";
}
else
{
echo "Il y a eu un problème durant le téléchargement. Veuillez réessayer.";
}
How do I go about this?