Hi Jose,
The path doesn't have to be an absolute URL. Only your script needs to know what directory the image is stored in relative to itself. For example:
In some of my sites, I allow the customer to upload images of products. Their website is in a directory such as:
htdocs/custwwwsite/
I place all of the scripts and pages that allow them to manage their content in a secured directory such as:
htdocs/custwwwsite/secdir/
The script that allows them to maintain the product database is in the secured directory and allows them to upload an image for the item (say "item001" (or whatever they call it). The form processor knows to copy the image that they upload into the main website directory and rename it to something I can be sure is unique so it doesn't copy over another image:
$newName = $item."jpg";
@copy($uploadFileName, ../$newName);
This copies the uploaded file with my new file name to the customer's main website directory (notice the "../"). If you store your images in an images subdirectory off the main directory you could use:
@copy($uploadFileName, ../images/$newName);
Only the new name has to be stored in the database without any path information (ex: "item001.jpg"). It is assumed that the script accessing the database later to create a page where the image will be displayed also knows what directory the image is stored in. If (as in the case of my customer's websites) that script is in the main website directory, then the image name retrieved from the database can be placed directly into the "SRC" attribute of the <IMG> tag and work perfectly:
<IMG SRC="<? echo $imageFieldName; ?>">
Or in the case of the "images" subdirectory:
<IMG SRC="/images/<? echo $imageFieldName; ?>">
Let me know if this makes sense to you; I know it was rather long, but I thought an example would be best.
-- Rich --