Results 1 to 7 of 7

Thread: Site Linking

  1. #1
    Join Date
    Nov 2006
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Site Linking

    OK, so me and another guy trying to make up a PHP script that will link multiple sites (100+) together. The idea is that their is an organization, and different people have sites within this organization but on different domains. So what we want is to have a PHP page that people can upload to their site that would call to a certain PHP script/page on a different server(or on their site) that would just insert all of these links to different pages, by name (alphabetically), date added, etc... Sound hard? How would you accomplish this idea?

    Here is what we got so far.
    Code:
    <?php  include("list_of_sites.php");
     ?>
    How would you accomplish the "list_of_sites.php" page?

    -GT

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    One thing you could utilize is a database setup. On one of the servers, make a database that has a list of all of the website information in it, then in the "list_of_sites.php" page, call upon the database for the list of names. In the database include the urls of the domains, and the site names.

    This would look almost like the following:

    PHP Code:
    <!--Place your html code here to make the list of sites-->

    <?php
    $server 
    "mydomain.com"//url for the mysql server
    $DBuser "username"//database username
    $DBpass "password"//database password
    $DB "list_sites"//actual database name for site info

    $conn mysql_connect($server,$DBuser,$DBpass);
    mysql_select_db($DB);

    $sites mysql_query("SELECT * FROM `sites`");

    while (
    $qry mysql_fetch_array($sites)) {
    echo 
    '<a href='.$qry[siteurl].'>'.$qry[sitename].'</a><BR>';
    }
    ?>
    Another thing you could try is using an iframe to show "list_of_sites.php" (which is hosted on one server, but shown on all of the ones that are part of this community). These are just a couple of options that you could utilize. Hope this helps somewhat.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Nov 2006
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by thetestingsite View Post
    One thing you could utilize is a database setup. On one of the servers, make a database that has a list of all of the website information in it, then in the "list_of_sites.php" page, call upon the database for the list of names. In the database include the urls of the domains, and the site names.

    This would look almost like the following:

    PHP Code:
    <!--Place your html code here to make the list of sites-->

    <?php
    $server 
    "mydomain.com"//url for the mysql server
    $DBuser "username"//database username
    $DBpass "password"//database password
    $DB "list_sites"//actual database name for site info

    $conn mysql_connect($server,$DBuser,$DBpass);
    mysql_select_db($DB);

    $sites mysql_query("SELECT * FROM `sites`");

    while (
    $qry mysql_fetch_array($sites)) {
    echo 
    '<a href='.$qry[siteurl].'>'.$qry[sitename].'</a><BR>';
    }
    ?>
    Wow, I never even thought about using a DB for this... Excelent idea. One question, with this setup would people be able to easily find their way to all of the DB information (username, password, etc..)? Also, while on the subject what would you do so that people inside of our community with hosts that do not support PHP, so that they can be a part of our network?

    -GT
    Last edited by GhettoT; 11-30-2006 at 04:42 AM.

  4. #4
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Quote Originally Posted by thetestingsite View Post
    Another thing you could try is using an iframe to show "list_of_sites.php" (which is hosted on one server, but shown on all of the ones that are part of this community).
    In other words, host the list_of_sites.php page on the "main server" and either post a link to it, or use an iframe or some other form of displaying the data on the no-supported websites. Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    That PHP function (include) will put the contents of that html on your page. Not sure if that's your intent.

    Yeah... if you want it to work dynamically, with forms, user input, organization, etc. use a database.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    Nov 2006
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    sounds good. Also, with the iFrame would it look like this,
    Code:
    <P ALIGN=center>
    <IFRAME SRC="PATH/TO/HTML.html" TITLE="FIRST Team Network">
    <!-- Alt. content for non-supported browsers -->
    <H2>FIRST Team Network</H2>
    <H3>Links</H3>
    ...
    </IFRAME></P>
    -GT

  7. #7
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Quote Originally Posted by GhettoT View Post
    sounds good. Also, with the iFrame would it look like this,
    Code:
    <P ALIGN=center>
    <IFRAME SRC="PATH/TO/HTML.html" TITLE="FIRST Team Network">
    <!-- Alt. content for non-supported browsers -->
    <H2>FIRST Team Network</H2>
    <H3>Links</H3>
    ...
    </IFRAME></P>
    -GT
    Actually, in the src attribute, you would want to put the actual place as if accessing it from your address bar in your browser. (ex: http://mydomain.com/test.php) Hopefully this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

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
  •