THANK YOU IN ADVANCE
Here's the code I am using to upload the files.
<!--- PHP Portion Named uploads.php --->
<?php $updir = images;
if(!file_exists("$updir/$pic_name"))
{ copy($pic, "$updir" . "/" . $pic_name); }
else { echo "File already exists!"; } ?>
This works Perfect, but the only thing is, If I have two users come and upload files which are named the same it will echo file already exists.
So PART 2, To solve this problem I would like to append a unique identifier like a user name. The form portion code which is named upload.html is:
<form enctype="multipart/form-data" action="http://www.mydomain.us/members/upload.php" method="post"> <input name="pic" type="file" size="20"></td> <input type="submit" value="Upload" name="upload">
So MY QUESTION:
How TO and IS IT POSSIBLE to add a form field in this same form above but make it username and when the user clicks on upload it will upload the image but add the username they entered into the form so such instead of when they upload arrow.gif it will be username_arrow.gif
Then Give us a way to call the same file they uploaded in the upload.html file in a page called my items.html
------------------------------------IDEA of what I am Trying to Do-----
I have a domain and have members in that domain. So the members website address is mydomain.com/theirusername
Now I added a image folder in the member folder so the form sends the image to the one folder that all my members share.
The reason why they are uploading images is for their Products Page.
The Products page will have THEIR image with product Description, and Price. I want their image to be called and displayed on this page. I would like to put something like
<?=$row['product']?>
for the image and ONLY the owner's image appears.