+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 9 of 17
  1. #1
    Tech N3rd Super #1 Twist3d's Avatar
    Member since
    Dec 2007
    Location
    IA
    posts
    1,939
    Gave thanks
    44
    Thanked 65 times

    Is there a way to pull .php files from another server?

    This is what i want to do.

    I am sharing the same list of links between two domains.

    Lets call them Domain1.com and Domain2.com

    Is there a way to pull a php file from domain1.com/links.php into domain2.com/links.php

    Thanks
    Pass 70 SH 110
    Need Vinyl Stickers? Please contact us at Insane Vinyls!

  2. #2
    Surpass Fan Comfy Contributor jdcopelin's Avatar
    Member since
    Feb 2004
    Location
    Norfolk, England
    posts
    180
    Gave thanks
    25
    Thanked 20 times
    Hi,

    I don't think you can do this exactly how you describe because by typing in the name of a .php file into a browser, the server will execute the file rather than expose its source code. How is the list generated? ie could you save them in a separate file (like a .txt file on the server which the other domain can also access) and have the two php files parse the file and render the links on the page. Does that help, or have I misinterpreted what you want to achieve?

    Cheers,
    Jonathan
    Server: Pass32 and dedicated server

  3. #3
    Tech N3rd Super #1 Twist3d's Avatar
    Member since
    Dec 2007
    Location
    IA
    posts
    1,939
    Gave thanks
    44
    Thanked 65 times
    You have the right idea. I just want both sites to feed from one single file located on ONE of the two domains.

    I want it so I can update that one file and it updates the list on both domains.

    I guess a .txt file would work but not sure exactly how to pull data from a .txt file
    Pass 70 SH 110
    Need Vinyl Stickers? Please contact us at Insane Vinyls!

  4. #4
    Surpass Fan Super #1 fury's Avatar
    Member since
    Dec 2005
    Location
    MN > USA
    posts
    2,221
    Gave thanks
    104
    Thanked 120 times
    You could do a text file on one and use cURL to read it from the other site.

    Or use a database. Which would be easier in my opinion.
    fury™ - not helping the situation since 1987
    robmonroe.net | Twitter | Foursquare

  5. #5
    Tech N3rd Super #1 Twist3d's Avatar
    Member since
    Dec 2007
    Location
    IA
    posts
    1,939
    Gave thanks
    44
    Thanked 65 times
    Any tips on how to set that up?
    Pass 70 SH 110
    Need Vinyl Stickers? Please contact us at Insane Vinyls!

  6. #6
    Skittles Super #1 DewKnight's Avatar
    Member since
    Aug 2004
    Location
    a space ship
    posts
    7,294
    Gave thanks
    119
    Thanked 241 times
    It depends on the type of info you're wanting to use. as fury mentioned, it would probably be easiest to use a database.

    Set up the database (with user and pass) on one domain. configure the page on that domain to connect to that database locally.

    Next configure the page on the other domain to connect to the first domain's database remotely. You will also have to add the server IP of the second domain into the remote mysql access list in cPanel on the first domain.
    Russell P. - Server Analyst II
    Mountain Dew Knight

  7. #7
    Tech N3rd Super #1 Twist3d's Avatar
    Member since
    Dec 2007
    Location
    IA
    posts
    1,939
    Gave thanks
    44
    Thanked 65 times
    Sounds like a pain in the ass to do something that should be simple.
    Pass 70 SH 110
    Need Vinyl Stickers? Please contact us at Insane Vinyls!

  8. #8
    Skittles Super #1 DewKnight's Avatar
    Member since
    Aug 2004
    Location
    a space ship
    posts
    7,294
    Gave thanks
    119
    Thanked 241 times
    You could also do it with text files and cURL. The reason you can't do it with PHP files is they are interpreted by the server before being displayed. Now if you want to just use the info and not interact with the page, it can work.

    It all depends on the type of data you're looking to share across domains.
    Russell P. - Server Analyst II
    Mountain Dew Knight

  9. #9
    Surpass Fan Super #1 fury's Avatar
    Member since
    Dec 2005
    Location
    MN > USA
    posts
    2,221
    Gave thanks
    104
    Thanked 120 times
    If the domains are both on the same server (as in, here on Surpass), you don't need to add the remote IP.

    The database option is rather simple, but it does require some knowledge of PHP/mySQL and phpMyAdmin.

    To go the text file route, a Google search should result in plenty of information on how to accomplish this with cURL.
    fury™ - not helping the situation since 1987
    robmonroe.net | Twitter | Foursquare

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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