<?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>Random Geekage &#187; images</title>
	<atom:link href="http://kevinisageek.org/tag/images/feed/" rel="self" type="application/rss+xml" />
	<link>http://kevinisageek.org</link>
	<description>Randomness, geekery and whatever else I feel like</description>
	<lastBuildDate>Thu, 20 May 2010 10:29:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Random images as a background in HTML</title>
		<link>http://kevinisageek.org/2009/02/06/random-images-as-a-background-in-html/</link>
		<comments>http://kevinisageek.org/2009/02/06/random-images-as-a-background-in-html/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 21:17:20 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Random Knowlege]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[random]]></category>

		<guid isPermaLink="false">http://kevinisageek.org/?p=418</guid>
		<description><![CDATA[A nice wee gem that Alex Peake informed me was possible. The problem: you want a randomly chosen image as a background but don&#8217;t want duplication in your css. In your css file: background-image: url('images/background.php'); Create the file referenced above with this code: &#60;?php     $numofimages = count(glob("*.jpg"));     $imagenum = rand(1, $numofimages);     header("Content-Type: [...]]]></description>
			<content:encoded><![CDATA[<p>A nice wee gem that <a href="http://empowerthyself.com">Alex Peake</a> informed me was possible. The problem: you want a randomly chosen image as a background but don&#8217;t want duplication in your css.</p>
<p>In your css file:</p>
<pre>background-image: url('images/background.php');</pre>
<p>Create the file referenced above with this code:</p>
<pre>&lt;?php
    $numofimages = count(glob("*.jpg"));
    $imagenum = rand(1, $numofimages);

    header("Content-Type: image/jpeg\n");
    header("Content-Transfer-Encoding: binary");

    $fp=fopen("headerimage". $imagenum .".jpg" , "r");
    fpassthru($fp);
?&gt;</pre>
<p>and voila, random images as a background with the bonus of being able to throw in a new image without having to do any more coding.</p>
<p>This code assumes that your images are called headerimageX.jpg where X is a number.</p>
]]></content:encoded>
			<wfw:commentRss>http://kevinisageek.org/2009/02/06/random-images-as-a-background-in-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
