Jump to content

Archived

This topic is now archived and is closed to further replies.

Immortal55

Database path store...

Recommended Posts

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.php

upload.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....

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.