Jump to content

[SOLVED] problem with include(http://www.mydomain.com/template.php);


elias

Recommended Posts

hi guys and gals!

 

I have 20 domains which (to make life simpler) all share the same template pages and data base which reside in another domain.

 

Since changing server, I have found that my pages that used to load at normal speeds are now taking 20-40 seconds (completely unacceptable  :P)

 

I have narrowed down the problem to this one line:

 

include("http://www.mydomain.com/template.php?site_id=$site_id");

 

where $site_id are my 20 domains - eg: ItemA, ItemB, etc.

 

Basically my 20 index pages sit in their own domains and call my templates which reside in www.mydomain.com

 

It used to work, but now as I said, it takes forever to load, and I know this is the culprit because if I just call http://www.mydomain.com/template.php?site_id=ItemA from my browser it comes back instantly.

 

Any ideas...... I have tried include and require, but it does not seem to make a difference (and by the way, what are the difference between these two commands)

 

Anyhow, any pointers would be greatly appreciated!!!

 

cheers and have a nice weekend

 

elias

hi jesirose

 

Thanks for your input, but how do you think I could achieve the desired effect - it must be possible.

 

I want to have a template sitting in domain A with a database linked to it, and then I want 20 other domains, B, C, D, etc. elsewhere to all be able to call on this template so I dont have to have 20 pages and 20 data bases - there must be a way, right?

 

cheers

 

elias

Could use fopen...http://us2.php.net/manual/en/function.fopen.php for a quick and dirty way of doing it.

Or file_get_contents for an even simpler way...http://us2.php.net/manual/en/function.file-get-contents.php (no file handles or anything).

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.