fredbernardwood Posted July 13, 2009 Share Posted July 13, 2009 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! Quote Link to comment https://forums.phpfreaks.com/topic/165809-total-beginner-direction-needed-on-pdf-archive-displayretrieval/ Share on other sites More sharing options...
JonnoTheDev Posted July 13, 2009 Share Posted July 13, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/165809-total-beginner-direction-needed-on-pdf-archive-displayretrieval/#findComment-874592 Share on other sites More sharing options...
fredbernardwood Posted July 13, 2009 Author Share Posted July 13, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/165809-total-beginner-direction-needed-on-pdf-archive-displayretrieval/#findComment-874819 Share on other sites More sharing options...
JonnoTheDev Posted July 14, 2009 Share Posted July 14, 2009 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'] Quote Link to comment https://forums.phpfreaks.com/topic/165809-total-beginner-direction-needed-on-pdf-archive-displayretrieval/#findComment-875038 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.