Jump to content

Cross domain includes


aleX_hill

Recommended Posts

Ok, here is the situation. I have a few sites which all use the same functions (while connected to different dbs) to display content. Instead of updating each site when there is a change, I want to include all the display functions in one file, hosted on a different domain, and include that file on each site.

 

So, being on shared hosting, allow_url_fopen isnt an option.

 

I havent used CURL before, but I tried the code below, but that doesnt work either:

$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_URL,'http://myurl.com/functions/siteFunctions1.0.php');
curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,10);
curl_exec($curl_handle);
curl_close($curl_handle);

 

Is CURL an option for this, or is there another way that I can go about it?

 

Cheers,

Alex

Link to comment
https://forums.phpfreaks.com/topic/208917-cross-domain-includes/
Share on other sites

Well doesnt that suck. I wont be able to mount drives being on a hosted server. Looks like I am stuck with editing 10 files each time I make a small change :(

 

Unless I write a cron to periodically replace the PHP files with the content from the "master" PHP file... now there is an idea

I dont use a version control system, I just upload the files from dreamweaver. Much of the time there are edits to the other files on the website, ie the actual page structure, css files etc, the only similar file is the one holding the functions.

 

Can you suggest a decent (preferably freeware) version control system for Windows?

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.