Reading a Remote File Using PHP - Is it good or not?
I want to use the code below to include a specific file (ex: terms.php) to all my web pages located on various servers.
|
$ content = file_get_contents('http://www.google.com/'); if ($ content !== false) { // my echo here } else { // an error happened } |
Let say I have 3 servers, A, B and C.
Then I have 3 different sites in server A, B and C.
Each sites will have same navigation at the end of the page which I will create a navigation.php file and place it on server A.
Then, I will use those code to get the navigation.php content from server A to appear on all of my web pages (in server A, B and C).
So, what I do want to know is this method is really effective? Does this method will affect my web pages loading time?
I used to use ssi method but I want to know is this method is more efective than ssi?
The reason of using this method is, I want to easily change some of the content especially for the terms/navigation/offers in all my webpages.
Thank you for your reply.
-A.Z
Need help with PHP and Laravel?
WSO 003 - How To Create A Sales Page Generator
WSO 003 - How To Create A Sales Page Generator
Need help with PHP and Laravel?