<?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: Simple Random Image With PHP</title>
	<atom:link href="http://www.elanman.co.uk/2009/06/simple-random-image-with-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.elanman.co.uk/2009/06/simple-random-image-with-php/</link>
	<description>ElanMan&#039;s Code Snippets</description>
	<lastBuildDate>Tue, 24 Aug 2010 07:35:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: ElanMan</title>
		<link>http://www.elanman.co.uk/2009/06/simple-random-image-with-php/comment-page-1/#comment-160</link>
		<dc:creator>ElanMan</dc:creator>
		<pubDate>Sat, 02 Jan 2010 00:07:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.elanman.co.uk/?p=926#comment-160</guid>
		<description>Hi Hal, unfortunately, your comments have been buggered up by wordpress (or me). Could you please post them again inside &lt;pre&gt; tags?</description>
		<content:encoded><![CDATA[<p>Hi Hal, unfortunately, your comments have been buggered up by wordpress (or me). Could you please post them again inside &lt;pre&gt; tags?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hal</title>
		<link>http://www.elanman.co.uk/2009/06/simple-random-image-with-php/comment-page-1/#comment-159</link>
		<dc:creator>Hal</dc:creator>
		<pubDate>Fri, 01 Jan 2010 22:33:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.elanman.co.uk/?p=926#comment-159</guid>
		<description>The image tag should read:

&lt;code&gt;
 
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>The image tag should read:</p>
<p><code></p>
<p></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hal</title>
		<link>http://www.elanman.co.uk/2009/06/simple-random-image-with-php/comment-page-1/#comment-158</link>
		<dc:creator>Hal</dc:creator>
		<pubDate>Fri, 01 Jan 2010 22:32:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.elanman.co.uk/?p=926#comment-158</guid>
		<description>I&#039;m getting the same thing. No images, just alt text. The generated image tag is as such:



Using print_r, I also get a listing of files in the directory.

Any ideas?</description>
		<content:encoded><![CDATA[<p>I&#8217;m getting the same thing. No images, just alt text. The generated image tag is as such:</p>
<p>Using print_r, I also get a listing of files in the directory.</p>
<p>Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ElanMan</title>
		<link>http://www.elanman.co.uk/2009/06/simple-random-image-with-php/comment-page-1/#comment-144</link>
		<dc:creator>ElanMan</dc:creator>
		<pubDate>Thu, 29 Oct 2009 10:57:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.elanman.co.uk/?p=926#comment-144</guid>
		<description>Hi ALIT, the &#039;.&#039; and &#039;..&#039; simply reference the current directory and the parent directory; we don&#039;t need to worry about them here.
Check the generated source of the page to see where the image src attribute points to. Also, try giving your images slightly longer names, pic1.jpg&#039; for example.
Let me know how you get on :)</description>
		<content:encoded><![CDATA[<p>Hi ALIT, the &#8216;.&#8217; and &#8216;..&#8217; simply reference the current directory and the parent directory; we don&#8217;t need to worry about them here.<br />
Check the generated source of the page to see where the image src attribute points to. Also, try giving your images slightly longer names, pic1.jpg&#8217; for example.<br />
Let me know how you get on <img src='http://www.elanman.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ALIT</title>
		<link>http://www.elanman.co.uk/2009/06/simple-random-image-with-php/comment-page-1/#comment-143</link>
		<dc:creator>ALIT</dc:creator>
		<pubDate>Thu, 29 Oct 2009 09:44:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.elanman.co.uk/?p=926#comment-143</guid>
		<description>Thanks for the help ElanMan. Included that code and get the following

A Random ImageArray ( [0] =&gt; . [1] =&gt; .. [2] =&gt; 1.jpg [3] =&gt; 2.jpg )

At the moment there are only 2 images in my directory, 1.jpg and 2.jpg. Not sure why the first 2 entries in the array are there however. The directory is simply &quot;images/backgrounds/&quot;. Im using MAMP on a mac.</description>
		<content:encoded><![CDATA[<p>Thanks for the help ElanMan. Included that code and get the following</p>
<p>A Random ImageArray ( [0] =&gt; . [1] =&gt; .. [2] =&gt; 1.jpg [3] =&gt; 2.jpg )</p>
<p>At the moment there are only 2 images in my directory, 1.jpg and 2.jpg. Not sure why the first 2 entries in the array are there however. The directory is simply &#8220;images/backgrounds/&#8221;. Im using MAMP on a mac.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ElanMan</title>
		<link>http://www.elanman.co.uk/2009/06/simple-random-image-with-php/comment-page-1/#comment-142</link>
		<dc:creator>ElanMan</dc:creator>
		<pubDate>Wed, 28 Oct 2009 17:54:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.elanman.co.uk/?p=926#comment-142</guid>
		<description>Hi ALIT,
So you&#039;re getting &#039;A Random Image&#039; as the alt text?
Directly after this code in the function:
&lt;pre lang=&quot;php&quot;&gt;
echo &#039;&lt;img src=&quot;&#039; . $imgs[$newrandImg] . &#039;&quot; alt=&quot;A Random Image&quot; /&gt;&#039;;
&lt;/pre&gt;
place the following and let me know what it prints out.
&lt;pre lang=&quot;php&quot;&gt;
print_r($files);
&lt;/pre&gt;
It should print out an array of the files in the directory.</description>
		<content:encoded><![CDATA[<p>Hi ALIT,<br />
So you&#8217;re getting &#8216;A Random Image&#8217; as the alt text?<br />
Directly after this code in the function:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;img src=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$imgs</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$newrandImg</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot; alt=&quot;A Random Image&quot; /&gt;'</span><span style="color: #339933;">;</span></pre></div></div>

<p>place the following and let me know what it prints out.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$files</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>It should print out an array of the files in the directory.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ALIT</title>
		<link>http://www.elanman.co.uk/2009/06/simple-random-image-with-php/comment-page-1/#comment-141</link>
		<dc:creator>ALIT</dc:creator>
		<pubDate>Wed, 28 Oct 2009 12:22:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.elanman.co.uk/?p=926#comment-141</guid>
		<description>Really helpfull, but im still a little confused. Quite new to php but, Ive presumed &#039;phprotateimages&#039; your image directory, and ive set mine accordingly.

However im still not getting any images. Simply the displaying the alt attribute, but NOT the &quot;Couldn&#039;t read the file directory&quot;.

Can you help?</description>
		<content:encoded><![CDATA[<p>Really helpfull, but im still a little confused. Quite new to php but, Ive presumed &#8216;phprotateimages&#8217; your image directory, and ive set mine accordingly.</p>
<p>However im still not getting any images. Simply the displaying the alt attribute, but NOT the &#8220;Couldn&#8217;t read the file directory&#8221;.</p>
<p>Can you help?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ElanMan</title>
		<link>http://www.elanman.co.uk/2009/06/simple-random-image-with-php/comment-page-1/#comment-138</link>
		<dc:creator>ElanMan</dc:creator>
		<pubDate>Tue, 13 Oct 2009 18:03:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.elanman.co.uk/?p=926#comment-138</guid>
		<description>Glad you found it useful :)</description>
		<content:encoded><![CDATA[<p>Glad you found it useful <img src='http://www.elanman.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: What Work?</title>
		<link>http://www.elanman.co.uk/2009/06/simple-random-image-with-php/comment-page-1/#comment-137</link>
		<dc:creator>What Work?</dc:creator>
		<pubDate>Tue, 13 Oct 2009 17:52:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.elanman.co.uk/?p=926#comment-137</guid>
		<description>Awesome, a simple change and I made it into a rotating ad function :)</description>
		<content:encoded><![CDATA[<p>Awesome, a simple change and I made it into a rotating ad function <img src='http://www.elanman.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott S</title>
		<link>http://www.elanman.co.uk/2009/06/simple-random-image-with-php/comment-page-1/#comment-99</link>
		<dc:creator>Scott S</dc:creator>
		<pubDate>Tue, 23 Jun 2009 21:12:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.elanman.co.uk/?p=926#comment-99</guid>
		<description>Another nice article there mate :)

Dugg!</description>
		<content:encoded><![CDATA[<p>Another nice article there mate <img src='http://www.elanman.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Dugg!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
