Hi i have this upload image to server but i'm having a problem with the path name of the image when i save on the database it saves like
images/madrid.jpg now i just want to save as madrid.jpg it does that because of this line in the script
$newname="images/".$image_name;
i tried to delete images/ but then it wont save in the images folder has that is the name of the directory and the image name which save on the database how can i separate so it copies on the image folder and still send the path name??
the code
$image_name=time().'.'.$extension;
//the new name will be containing the full path where will be stored (images folder)
$newname="images/".$image_name;
$copied = copy($_FILES['image']['tmp_name'], $newname);
//we verify if the image has been uploaded, and print error instead
if (!$copied)
{
echo '<h1>Copy unsuccessfull!</h1>';
$errors=1;
}