Immortal55 Posted March 31, 2006 Share Posted March 31, 2006 Alright, how in the world can I do this:uploadforms.php - A form where you simply input a title, choose a file to upload, add a comment for the file, and select a catagory for the file. All of this info is then passed onto upload.phpupload.php - this takes the info from the forms puts it in a database, I know how to get all the text into the database, but how can i store the file location of the file in the DB (the location of the file on the server)? I cannot seem to get this, and I have been at it for weeks.... Quote Link to comment Share on other sites More sharing options...
Barand Posted March 31, 2006 Share Posted March 31, 2006 When you upload a file it is put in a temporary location on the server. It is then up to to move this file (move_uploaded_file() ) to wherever to want to store it, renaming as required.Having defined the path to where you want to store it, store that path in database. It's completely under your control. Quote Link to comment Share on other sites More sharing options...
craygo Posted March 31, 2006 Share Posted March 31, 2006 If you keep all the files in the same place, don't even bother keeping the path in the database. Just call on it when you display the page.If you have a directory called images then call it with the html[code]<img src="images/<?=$filename?>">[/code]Ray Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.