icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » PHP, MySQL » Is there a way to pull .php files from another server?

PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >>

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old February 7th, 2010, 3:42 PM   #1 (permalink)
Twist3d One
Super #1
 
Twist3d's Avatar
 
Joined in Dec 2007
Lives in IA
Hosted on pass81 & sh110
1,887 posts
Gave thanks: 44
Thanked 62 times
Send a message via ICQ to Twist3d Send a message via AIM to Twist3d Send a message via MSN to Twist3d Send a message via Yahoo to Twist3d Send a message via Skype™ to Twist3d
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 81 SH 110
Twist3d is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 7th, 2010, 3:56 PM   #2 (permalink)
Surpass Fan
Comfy Contributor
 
jdcopelin's Avatar
 
Joined in Feb 2004
Lives in Norfolk, England
Hosted on Pass32
176 posts
Gave thanks: 25
Thanked 19 times
Send a message via MSN to jdcopelin
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
jdcopelin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 7th, 2010, 4:31 PM   #3 (permalink)
Twist3d One
Super #1
 
Twist3d's Avatar
 
Joined in Dec 2007
Lives in IA
Hosted on pass81 & sh110
1,887 posts
Gave thanks: 44
Thanked 62 times
Send a message via ICQ to Twist3d Send a message via AIM to Twist3d Send a message via MSN to Twist3d Send a message via Yahoo to Twist3d Send a message via Skype™ to Twist3d
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 81 SH 110
Twist3d is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 7th, 2010, 5:47 PM   #4 (permalink)
Surpass Fan
Super #1
 
fury's Avatar
 
Joined in Dec 2005
Lives in MN > USA
Hosted on pass84
2,140 posts
Gave thanks: 89
Thanked 112 times
Send a message via AIM to fury Send a message via Skype™ to fury
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
fury is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 7th, 2010, 5:50 PM   #5 (permalink)
Twist3d One
Super #1
 
Twist3d's Avatar
 
Joined in Dec 2007
Lives in IA
Hosted on pass81 & sh110
1,887 posts
Gave thanks: 44
Thanked 62 times
Send a message via ICQ to Twist3d Send a message via AIM to Twist3d Send a message via MSN to Twist3d Send a message via Yahoo to Twist3d Send a message via Skype™ to Twist3d
Any tips on how to set that up?
__________________
Pass 81 SH 110
Twist3d is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 7th, 2010, 6:12 PM   #6 (permalink)
Skittles
Super #1
 
DewKnight's Avatar
 
Joined in Aug 2004
Lives in a space ship
Hosted on dedi
7,239 posts
Gave thanks: 118
Thanked 236 times
Send a message via AIM to DewKnight Send a message via MSN to DewKnight Send a message via Yahoo to DewKnight
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 I
Mountain Dew Knight
DewKnight is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 7th, 2010, 6:22 PM   #7 (permalink)
Twist3d One
Super #1
 
Twist3d's Avatar
 
Joined in Dec 2007
Lives in IA
Hosted on pass81 & sh110
1,887 posts
Gave thanks: 44
Thanked 62 times
Send a message via ICQ to Twist3d Send a message via AIM to Twist3d Send a message via MSN to Twist3d Send a message via Yahoo to Twist3d Send a message via Skype™ to Twist3d
Sounds like a pain in the ass to do something that should be simple.
__________________
Pass 81 SH 110
Twist3d is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 7th, 2010, 7:03 PM   #8 (permalink)
Skittles
Super #1
 
DewKnight's Avatar
 
Joined in Aug 2004
Lives in a space ship
Hosted on dedi
7,239 posts
Gave thanks: 118
Thanked 236 times
Send a message via AIM to DewKnight Send a message via MSN to DewKnight Send a message via Yahoo to DewKnight
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 I
Mountain Dew Knight
DewKnight is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 7th, 2010, 7:49 PM   #9 (permalink)
Surpass Fan
Super #1
 
fury's Avatar
 
Joined in Dec 2005
Lives in MN > USA
Hosted on pass84
2,140 posts
Gave thanks: 89
Thanked 112 times
Send a message via AIM to fury Send a message via Skype™ to fury
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
fury is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On