Alright what I want to do is have a section where a member can upload a image to a specific folder on my ftp and store the filename in a mysql db? Anyone got any ideas?
Create a FORM with a file field, use copy() function to upload. 🙂
i need to know how to make the file name a random name and save to a mysql database
You can assign a new filename when you are uploading the file from client to the server. Something like this:
$newfilename="somename.ext"; copy($newfilename,$_FILES['tmp_name']);
hwo do i make that random every time?
i want it to save a random filename because i dont want the same file to be saved twice...but i dont know the code to create a random word out of 8 characters
Just append the ID of the next record to the filename.
$filename="file" . $id . ".txt";
The extension can be made dynamic by checking the file type user is uploading. $_FILES['type']; as simple as that. 🙂
hmm forgive me since i dont know everything...but how does that make it random?!
$id will make it random since you cant have the same id for each record in your table. I mean primary key must be Unique.
Since you have a very vaque idea on what I have mentioned, I would suggest you to browse this forum for several issues:
🙂