IT Community - Software Programming, Web Development and Technical Support

How to include file from different server

This is a discussion on How to include file from different server within the PHP Programming forums, part of the Web Development category; Hi, I have a file named test1.php in server 1, and another file named test2.php in server 2, ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > PHP Programming

Register FAQ Members List Calendar Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 07-12-2007, 04:25 AM
Arun Arun is offline
D-Web Trainee
 
Join Date: Mar 2007
Posts: 43
Arun is on a distinguished road
Question How to include file from different server

Hi,

I have a file named test1.php in server 1,
and another file named test2.php in server 2, I wish to include test1.php in the file test2.php. Can anyone help?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-12-2007, 05:04 AM
ThaNerd ThaNerd is offline
D-Web Trainee
 
Join Date: Jul 2007
Posts: 8
ThaNerd is on a distinguished road
Default Re: How to include file from different server

There are possibilities to achive this, but they imply so much work that it'd be much easier to have a cron job on server 2 checking last modified date of file2 and upload the file to server 1 if it has been changed...

I mean, really...

In case you have a way to have the file2.php to be displayed without being parsed by the web server (which is in NO CASE secure at all), the process would be:
Code:
$foreignCode = implode('',file('http://www.server2.com/file2.php'));
eval($foreignCode);
On server2, if the file is used like require('file2') or include('file2'), name it in .txt so that apache won't try to interpret it when server1 downoads it... include will still work, whaever be the filename.

Finally, remember that it is a Very Bad Idea™ to have server 1 connect to server 2 every time an end-user request a page on server 1...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

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

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/php-programming/1613-how-include-file-different-server.html
Posted By For Type Date
How to include file from different server | Web Hosting This thread Refback 03-05-2008 09:39 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to insert data from a csv file into a SQL server database? $enthil Database Support 7 05-01-2008 10:45 PM
JavaScript to include flash file in asp.net kingmaker ASP and ASP.NET Programming 3 03-10-2008 03:20 AM
How to refresh an include js file every 10 seconds? kingmaker HTML, CSS and Javascript Coding Techniques 1 11-28-2007 11:12 PM
Preview Image before Uploading File to Server velhari HTML, CSS and Javascript Coding Techniques 1 11-12-2007 10:21 PM
how to access local file from server? varghese HTML, CSS and Javascript Coding Techniques 5 10-18-2007 12:15 AM


All times are GMT -7. The time now is 02:34 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0