1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

How would I go about setting up my archive? Suggestions

Discussion in 'Web Design & Development' started by The Infinity, Aug 2, 2006.

Thread Status:
Not open for further replies.
Advertisement
  1. The Infinity

    The Infinity Thread Starter

    Joined:
    May 11, 2005
    Messages:
    579
    I have limited things I can do with my current (free) web hosting and I want to make an archive for my News Articles that are on my main page. But I'm unsure of how to do it nice an neat with the current setup I have. All my pages are coded as php and if I were to move the News php file to another folder on the server the images would not show up because they are in another directory. What would be the best way for me to make an archive for my News Articles so if one person does not get to read them one day they can go back and read them some other time from the archive.

    Any suggestions would greatly help.
     
  2. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,334
    If the site is running PHP as a front end with a database back end containing the news articles there is no need to archive anything just script your news page to not show articles older than a certain date, week or month. If it is not using a database back end I am not sure why it would be in PHP or any server side scripting.
     
  3. The Infinity

    The Infinity Thread Starter

    Joined:
    May 11, 2005
    Messages:
    579
    Sorry if this is a bad question but how would I go about doing that. I just figured out how to transfer my site to PHP and so I'm pretty new at it. I'm sorry if this is too much to ask.
     
  4. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,334
    PHP is a server side language that can communicate with back end databases to display content based on what is in the database. Why did you "transfer your site to PHP" if you aren't doing any of the above? Seems like plain HTML would have done what you need. You might want to download MySQL and try some development and database design locally prior to putting something up on your web site. I would also ask your web host to see if you also get a MySQL database with your PHP hosting.
     
  5. The Infinity

    The Infinity Thread Starter

    Joined:
    May 11, 2005
    Messages:
    579
    Well I did use basic HTML for awhile but my site has grown so much that I have not the time to spend on it like I used to so PHP is a lot more easy for upgrades and such. I would love to archive the news and If you click the link in my Signature called "Soft Hardware" thats my site. Maybe you can see what I'm trying to do. At the end of the news article there is a News Archive button you can click to bring you to the archive.

    Now if you picture on the FTP server a list of archived news files that are added everyday.

    August 2, 2006 = on FTP Aug0206.php which is the file.
    Now if you add a new php file everyday, the main part of my FTP server for my hosting is going to get overrun with the news archived files and will make it harder and harder for me to locate the main php files like for the main pages, that I need to edit. I wanted to move all of those news archivee files (Aug0206.php) to a folder called "News" on the FTP but if I do that the images will become broken because they are being moved out of place. What I'm really trying to ask I guess is what is the best way to put those archived news php files into a folder without breaking the links to the images and such.

    I hope that makes since, thats the best way I fee lI can explain it lol. Sorry if there was any confusion.
     
  6. brendandonhu

    brendandonhu

    Joined:
    Jul 8, 2002
    Messages:
    14,681
    You can use <base href="directory"> to have it look for your images in that directory.
    But you will be better off putting your articles in a database and using PHP to select the ones you want.
     
  7. namenotfound

    namenotfound

    Joined:
    Apr 30, 2005
    Messages:
    3,012
    Variables, arrays, PHP SSI, time/date calculations, IF/ELSE, user agent detections, ip detection, country detection, over 100 different things you can do with PHP without using a Database.
     
  8. thecoalman

    thecoalman

    Joined:
    Mar 6, 2006
    Messages:
    2,491
    Get in the practice of placing your images in a single directory and use relative or absolute URL's. What I do is build the page on my local machine, then do a find and replace on the code so the source URL's are all absolute... instead of src="image.jpg" it gets changed to src="http://www.yoursite/images/image.jpg" for upload.

    http://www.google.com/search?source...rls=GGLG,GGLG:2005-22,GGLG:en&q=relative+urls
     
  9. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,334
    I am well aware of the functions available in PHP, the question is, is he using any of them or just using static HTLM and saving pages as PHP. A database driven web site would be more logical for what you are trying to do.
     
  10. The Infinity

    The Infinity Thread Starter

    Joined:
    May 11, 2005
    Messages:
    579
    What I did is took the parts on the left and right of my website which if you clicked on the link are the Navagation, Affiliates, Overview, and Stats sections and also the banner and coded them for PHP so they would update in their own sections. So I would not have to edit every single HTML page when I went and changed something on one. The only thing that remains the same on all of the pages is the middle part where most of the text goes.

    I have all my images on a folder called "images" on the FTP Server. all of my standard PHP files are on the main part of the FTP Server, and index.html is there also, redirecting my main page to index.php. The New's Archive I would like to be able to set up to where I can put all the News articles from the Main page into a folder on the FTP server called news. And then move those news PHP files over into that folder to archive all the news articles. If there may be an easy way of making it so when I change the directory of the news article from the main part of the FTP server to the news folder, without losing the images because they are located in the "images" folder on the FTP server that would be ideal. I have just started to get into PHP so please be very basic when explaining the diffrent things.

    Thank you guys for your help thus far, I really appreciate it.
     
  11. The Infinity

    The Infinity Thread Starter

    Joined:
    May 11, 2005
    Messages:
    579
    Sorry for the double post but I just read Brendans's post and it sounds like that may work. Where should I put this on my page? IN the body anywhere?
     
  12. brendandonhu

    brendandonhu

    Joined:
    Jul 8, 2002
    Messages:
    14,681
    In the <head>
    And just use <base href="http://mysite.com/images/">
     
  13. namenotfound

    namenotfound

    Joined:
    Apr 30, 2005
    Messages:
    3,012
    Why would you need that? Just upload "index.php" and remove "index.html".

    There is no reason to have one page to redirect to the other, unless your server doesn't reconise "index.php" as an "index file", in which case you can always add it as one in .htaccess

    But most servers are set-up to accept either file as an "index file".
     
  14. The Infinity

    The Infinity Thread Starter

    Joined:
    May 11, 2005
    Messages:
    579
    It's free hosting and it has to have index.html to work. so I just redirected it no big deal.... but thats besides the point.
     
  15. thecoalman

    thecoalman

    Joined:
    Mar 6, 2006
    Messages:
    2,491
    There's other resons for redirecting such as if a user has the page bookmarked. They'll get redirected instead of gettin a 404. Ideally you want to use mod rewrite to rewrite the new php page to the old .html extension. This insures any search engine rankings you have remain in place, any bookmarks remain intact etc. It's ideal because the url doesn't change. You need htaccess for that though.
     
  16. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/488869

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice