PDA

View Full Version : trying to make a pdf database



swissbeats
24 May 2011, 10:00 PM
Hey everyone, I'm revamping an old website and I have to make a page that displays the pdfs by title in the order they have been added. It also needs to have a site that will upload the pdfs onto the webserver that is separate from the list. This is to let the person who puts up the files do it easily, because they aren't web savvy. I'm not sure exactly how to start this; if a database would be best and how to make the site to upload. Any help would be appreciated. I'm using dreamweaver for now, and haven't used it much. I haven't done web design since using html when java was big. Thanks a lot.

cyberjef
25 May 2011, 10:18 PM
There are a lot of ways to do this. Easiest perhaps would be to just save all the pdf's to a folder on the server. There should be lot's of scripts that show you how to do this. Pick a language and a server.

Displaying the links requires a bit more and would be hard to figure out as a beginner. In PHP this could be something like:

<?php

if ($handle = opendir($_SERVER['DOCUMENT_ROOT'] . '/pdf_path')) {
while (false !== ($file = readdir($handle))){

if ($file != "." && $file != ".."){

$PATH = pathinfo($file);
echo <<<allthis
<div><a href="$file">$PATH[filename]</a></div>
allthis;
}
}
closedir($handle);
}

Most would probably do this as a database project, but it is not needed here and is bit more to pick up.

J