SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    FBI secret agent digitman's Avatar
    Join Date
    Sep 2004
    Location
    Work
    Posts
    697
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry Gimme your directory b***h!

    Hi and sorry for the obnoxious title of this thread .

    I run a directory script built in Php/Mysql on my website. I can add, edit, delete links and categories of links in the directory through this script. What I want to do is, I want to be able to show a list of all the links in the directory on my other websites, and when I add/remove a link on my main website, all the link lists' on my other websites get updated automatically.

    Any ideas on how I can accomplish this? I need this to be very simple and easy to use, such as updating one or two scripts to each website where I want the list of links to show up, and thats all. Appreciate your help in advance!

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    have your main script on your main website output just the links.

    then in your other sites

    PHP Code:
    echo file_get_contents('http://mainsite.com/link_list.php'); 
    however, this will be slow. consider using a cron job on your other websites to fetch the links from the main site once a day or whatever, saving it to a local file. that way you can just output the data from a local file instead of having to do an http request to another server each time.

    if cron isnt an option, you could just have a script on each website that will do the update for you when you run it. then you could just bookmark them all and update all your sites pretty quickly. or you could make a script on your main website that will run all the scripts on your other website when you update the main site.

  3. #3
    FBI secret agent digitman's Avatar
    Join Date
    Sep 2004
    Location
    Work
    Posts
    697
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maaaan, you're a genius! I can't believe it could be so simple !


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •