<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rowan &#187; php</title>
	<atom:link href="http://rowan.ijuru.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://rowan.ijuru.com</link>
	<description>Trying to make sense of it all</description>
	<lastBuildDate>Sun, 05 Oct 2008 15:46:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>AJAX across domains</title>
		<link>http://rowan.ijuru.com/2008/09/06/ajax-across-domains/</link>
		<comments>http://rowan.ijuru.com/2008/09/06/ajax-across-domains/#comments</comments>
		<pubDate>Sat, 06 Sep 2008 19:56:42 +0000</pubDate>
		<dc:creator>Rowan</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://rowan.ijuru.com/?p=227</guid>
		<description><![CDATA[Another problem I ran into in the course of my recent development of a PHP newsletter tool (Gutuma), was the restriction on AJAX requests to the same domain as the host page. I&#8217;ve developed some AJAX gadgets which can be placed on a user&#8217;s site and will send subscription requests to the newsletter tool&#8230; which [...]]]></description>
			<content:encoded><![CDATA[<p>Another problem I ran into in the course of my recent development of a PHP newsletter tool (<a href="http://ijuru.com/gutuma/">Gutuma</a>), was the restriction on AJAX requests to the same domain as the host page. I&#8217;ve developed some AJAX gadgets which can be placed on a user&#8217;s site and will send subscription requests to the newsletter tool&#8230; which might be hosted on a different domain.</p>
<p>If you&#8217;ve come across an &#8220;Access to restricted URI denied&#8221; error then you&#8217;re probably having the same problem. The solution is to use a proxy on the domain where the AJAX controls are hosted. This proxy receives the HTTP requests from the AJAX controls and can forward them on to the other domain.</p>
<p>For an example of how to do this, you can check out <a href="http://ijuru.com/gutuma/files/guproxy.zip">guproxy.php</a> which is my simple single file PHP script for forwarding AJAX requests (from the SACK AJAX library) to the AJAX interface of Gutuma. As a security precaution it limits forwarded requests based on the destination url, and the filters the POST variables to those used by Gutuma.  Other solutions I&#8217;ve seen don&#8217;t do this and thus leave your proxy script open to abuse.</p>
]]></content:encoded>
			<wfw:commentRss>http://rowan.ijuru.com/2008/09/06/ajax-across-domains/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Server-side Javascript merging</title>
		<link>http://rowan.ijuru.com/2008/09/05/server-side-javascript-merging/</link>
		<comments>http://rowan.ijuru.com/2008/09/05/server-side-javascript-merging/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 11:53:22 +0000</pubDate>
		<dc:creator>Rowan</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://rowan.ijuru.com/?p=214</guid>
		<description><![CDATA[Recently I&#8217;ve been working on PHP mailing list tool, and I wanted to make a simple Javascript API so that users can place dynamically generated gadgets onto their own pages. I wanted one JS file that could be included on a page, but as I was using a 3rd party AJAX Javascript library, this also [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve been working on PHP mailing list tool, and I wanted to make a simple Javascript API so that users can place dynamically generated gadgets onto their own pages. I wanted one JS file that could be included on a page, but as I was using a 3rd party AJAX Javascript library, this also had to be included. Unfortunately Javascript has no concept of an <em>include </em>or <em>import </em>statement. So my solution was to use some PHP to merge them on the server:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-Type: application/x-javascript'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
/**
 * This file is a server-side merge of first.js and second.js
 *
 * ------------------------------ first.js -------------------------------
 */
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'first.js'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
/**
 * ---------------------------- second.php ----------------------------
 */
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'second.js'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>This simple approach could be used where you&#8217;ve got a lot of JS files and you want to speed up access times.</p>
]]></content:encoded>
			<wfw:commentRss>http://rowan.ijuru.com/2008/09/05/server-side-javascript-merging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
