Jump to content

Recommended Posts

Hi.  I am working on an archival website (www.fredbernardwood.org) whose primary function is to archive and make available PDF files.  so far, I have been doing this the long tedious HTML way of typing in the table data, and cutting & pasting to every  page where I want that PDF link to appear. I know there are technologies out there, and I've looked through some tutorials, but am not sure which would help me the most.  I use BlueHost and they have all the PHP, MySql, PERL, CGI, Postgre, Ruby stuff.

 

My basic needs are to list date, title, and category information for PDF files, a link to the PDF, and be able to automatically cross-list those files in every topic area page that applies. Also make them searchable by the above plus keywords.

 

Feel free to look at http://www.fredbernardwood.org/indexpapers.htm to see exactly what I mean.

 

Thanks!

A simple MySQL database and a bit of php will solve this. Follow tutorials on using MySQL (query syntax) and PHP tutorials on connecting to MySQL, selecting / inserting / updating data from / to tables.

If you want to create an admin backend to upload pdf's then follow tutorials on file uploads.

Okay, I got it set up a little. Here's my next question: so i have various topic categories that each file can fit into - i'd like to be able to select the records that have a "y" in that category field (or any other method you suggest) which I understand how to do, but i'd also like, on the overall index, list the category titles (single or multiple) that each record has a "y" by. it seems to me this would involve some "if..then" language but I'm not sure how to do it. or some simpler "if category has Y in it, display "category name"

 

thanks

No you use the primary key of the category and pass it through the url to the page that displays the pdfs. Select the category using the id in the url. You only need 2 pages for the whole system:

1. Home page to display categories

2. Inner page to display pdfs from selected category

 

database

 

categories

========

catId

title

 

pdfs

========

pdfId

catId

title

filename

 

The category page select all categories

 

SELECT * FROM categories ORDER BY title ASC

 

loop out the data and make each link

 

i.e

category.php?catId=1 - Cat 1

category.php?catId=2 - Cat 2

category.php?catId=3 - Cat 3

 

On category.php select the pdfs from the catId

 

SELECT * FROM pdfs WHERE catId=$_GET['catId']

 

loop out the pdfs

 

Also select the category

SELECT * FROM categories WHERE catId=$_GET['catId']

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.