Dynadot โ€” .com Transfer

Alternative to PHP 'Include'?

SpaceshipSpaceship
Watch

Gene

Gene PimentelTop Member
Impact
487
I have many different websites, each one using a php include to insert content from my main source website. All are on the same server, and the server is set to allow php includes from one url to another. No problem.

I'd like to be able to include content in websites that reside on other servers (that I do not have control over). I want various site owners to be able to include my html content regardless of where they are hosted.

Is there a way to do this without the site owner having to custom tweak server settings? Is there another method other than php includes or iframes?

Thanks!
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
-Nick- said:
Best way is use XML to deliver the data and PHP to parse it on the sites receiving the data.
How would that be the best way? It's the most flexible way, sure. But if the goal is the most common - to get the content as widespread as possible - JS widgets are far superior. These days 90% of people with active websites have no clue how to parse an XML file and even with the knowledge it takes time and effort to parse, cache and present the data.
 
0
•••
If a guy knows how to put PHP Include he surely knows how to upload a XML parser precoded file and include that in is site code. Now that can be included as it will be on his own server.
 
0
•••
-Nick- said:
If a guy knows how to put PHP Include he surely knows how to upload a XML parser precoded file and include that in is site code. Now that can be included as it will be on his own server.

That assumes that the other site provides xml info on their content... Also, xml can be a pain, if you just want the content as displayed, file_get_contents is perfectly fine, xml is only good if you need to manipulate the content yourself.
 
0
•••
samuelhr said:
That assumes that the other site provides xml info on their content...
Ofcourse yes. I already wrote in Post #20

-Nick- said:
Best way is use XML to deliver the data and PHP to parse it on the sites receiving the data.

samuelhr said:
Also, xml can be a pain, if you just want the content as displayed, file_get_contents is perfectly fine, xml is only good if you need to manipulate the content yourself.
Giving XML gives the power to the user to style it out or use it in other advanced ways if he has any. I know most of them don't know what php include is but what about people who knows a bit. They are the ones who bring quality out of your content being syndicated to other sites. That is why RSS is named RSS. Sorry not getting into any debate over here. Just wanted to give an input because the title of the thread says alternative to PHP Include. So I didn't mentioned JS scripts or widgets that you get all around the internet. file_get_contents is perfectly fine. But giving XML would give better control to the users if they want better control. Otherwise it is all okay if they don't care to even tweak the parser it will be more or less same as file_get_contents.
 
Last edited:
0
•••
Oh yeah definitely. I forgot about XML & RSS. Listen, these are your safest options:
JavaScript
XML & RSS feed

I'd do the XML & RSS feed, just because it's a lot easier to do than JavaScript, and RSS is output by the server so your content will be crawled by spiders.

As with anything though, be careful with this kind of thing, because people can easily steal your site's content and competitively rank with your site. :hehe:
 
0
•••
EGS said:
Oh yeah definitely. I forgot about XML & RSS. Listen, these are your safest options:
JavaScript
XML & RSS feed

I'd do the XML & RSS feed, just because it's a lot easier to do than JavaScript, and RSS is output by the server so your content will be crawled by spiders.

As with anything though, be careful with this kind of thing, because people can easily steal your site's content and competitively rank with your site. :hehe:


But Gene wants to take content from other sites, he can't set it up himself, he needs a solution requiring no action from the site owner.
 
Last edited:
0
•••
SSI (Server Side includes)... just make a file called 'filename.inc' with whatever html you want to include and reference it anywhere on your site with:
<!--#include virtual="filename.inc" -->
 
0
•••
Menzo said:
SSI (Server Side includes)

SSI will only include local files. Gene wants to include remote content.
 
0
•••
Just to clarify, I will be the one providing content to lots of other sites. I want to provide them with a way to display my html content on their site, while retaining the "master copy" on my site, so whenever I update the page on my site it updates ALL sites that are including it.
 
0
•••
Appraise.net
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back