<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to include elements from different webpages using PHP or JavaScript to my home page?</title>
	<atom:link href="http://www.weez.com/2010/02/how-to-include-elements-from-different-webpages-using-php-or-javascript-to-my-home-page/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.weez.com/2010/02/how-to-include-elements-from-different-webpages-using-php-or-javascript-to-my-home-page/</link>
	<description>Solving everyday practical LAMP problems... one at a time</description>
	<lastBuildDate>Wed, 08 Feb 2012 23:54:01 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Sandeep M</title>
		<link>http://www.weez.com/2010/02/how-to-include-elements-from-different-webpages-using-php-or-javascript-to-my-home-page/comment-page-1/#comment-1147</link>
		<dc:creator>Sandeep M</dc:creator>
		<pubDate>Fri, 19 Feb 2010 17:03:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.weez.com/2010/02/how-to-include-elements-from-different-webpages-using-php-or-javascript-to-my-home-page/#comment-1147</guid>
		<description>You can do this in different ways as explained below
I. Using &quot;curl&quot; and fetch the page u want then parse it according to your display needs.
II. If website supports RSS Feeds just call the rss - xml and parse it according to your display needs
III. If website supports web services use REST services to get the content from the web service provider.

On this 3 methods you can choose any of them depending upon the site from which u r getting data or depending on your knowledge on those concepts. 

If you use curl then u need to know regix pattern matching to parse data.

The rest two can be parsed by using xpath.</description>
		<content:encoded><![CDATA[<p>You can do this in different ways as explained below<br />
I. Using &#8220;curl&#8221; and fetch the page u want then parse it according to your display needs.<br />
II. If website supports RSS Feeds just call the rss &#8211; xml and parse it according to your display needs<br />
III. If website supports web services use REST services to get the content from the web service provider.</p>
<p>On this 3 methods you can choose any of them depending upon the site from which u r getting data or depending on your knowledge on those concepts. </p>
<p>If you use curl then u need to know regix pattern matching to parse data.</p>
<p>The rest two can be parsed by using xpath.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fjandr</title>
		<link>http://www.weez.com/2010/02/how-to-include-elements-from-different-webpages-using-php-or-javascript-to-my-home-page/comment-page-1/#comment-1146</link>
		<dc:creator>Fjandr</dc:creator>
		<pubDate>Fri, 19 Feb 2010 16:58:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.weez.com/2010/02/how-to-include-elements-from-different-webpages-using-php-or-javascript-to-my-home-page/#comment-1146</guid>
		<description>There could easily be better ways to do this, but without actually seeing how your data is organized I only have one workable suggestion.

In post.php, add each post to array and then echo the array contents to output the posts. Then include post.php in homepage.php.

post.php
-------------
$post = array();
$post[0] = &quot;&lt;h1&gt;Post #1&lt;/h1&gt;This is post #1&quot;;
$post[1] = &quot;&lt;h1&gt;Post #2&lt;/h1&gt;This is post #2&quot;;
$post[2] = &quot;&lt;h1&gt;Post #3&lt;/h1&gt;This is post #3&quot;;
foreach ($post as $x) {
echo $x;
}
echo &quot;&lt;h1&gt;More posts&lt;/h1&gt;More posts here!&quot;;

myhome.php
-------------------
require_once(&#039;post.php&#039;); // Gives you access to all the stuff in post.php

echo &quot;Let&#039;s see the first three posts:&lt;br /&gt;&quot;;
foreach ($post as $x) {
echo $x;
}

echo &quot;Stuff on homepage other than top posts.&quot;;</description>
		<content:encoded><![CDATA[<p>There could easily be better ways to do this, but without actually seeing how your data is organized I only have one workable suggestion.</p>
<p>In post.php, add each post to array and then echo the array contents to output the posts. Then include post.php in homepage.php.</p>
<p>post.php<br />
&#8212;&#8212;&#8212;&#8212;-<br />
$post = array();<br />
$post[0] = &#8220;<br />
<h1>Post #1</h1>
<p>This is post #1&#8243;;<br />
$post[1] = &#8220;<br />
<h1>Post #2</h1>
<p>This is post #2&#8243;;<br />
$post[2] = &#8220;<br />
<h1>Post #3</h1>
<p>This is post #3&#8243;;<br />
foreach ($post as $x) {<br />
echo $x;<br />
}<br />
echo &#8220;<br />
<h1>More posts</h1>
<p>More posts here!&#8221;;</p>
<p>myhome.php<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
require_once(&#8216;post.php&#8217;); // Gives you access to all the stuff in post.php</p>
<p>echo &#8220;Let&#8217;s see the first three posts:<br />&#8220;;<br />
foreach ($post as $x) {<br />
echo $x;<br />
}</p>
<p>echo &#8220;Stuff on homepage other than top posts.&#8221;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George H</title>
		<link>http://www.weez.com/2010/02/how-to-include-elements-from-different-webpages-using-php-or-javascript-to-my-home-page/comment-page-1/#comment-1145</link>
		<dc:creator>George H</dc:creator>
		<pubDate>Fri, 19 Feb 2010 16:57:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.weez.com/2010/02/how-to-include-elements-from-different-webpages-using-php-or-javascript-to-my-home-page/#comment-1145</guid>
		<description>It really depends on how you are accessing your database....doesn&#039;t matter if it is SQL or flat files, but why not send a url variable to your post.php file like:

include (&#039;post.php?amount=3&#039;);  That way when you hit your post.php script you can check if there is an amount variable via the GET method and just do a quick for loop to display that many posts.  Hope this helps.</description>
		<content:encoded><![CDATA[<p>It really depends on how you are accessing your database&#8230;.doesn&#8217;t matter if it is SQL or flat files, but why not send a url variable to your post.php file like:</p>
<p>include (&#8216;post.php?amount=3&#8242;);  That way when you hit your post.php script you can check if there is an amount variable via the GET method and just do a quick for loop to display that many posts.  Hope this helps.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

