<?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>Matt Fraser &#187; Affiliate Marketing</title>
	<atom:link href="http://mattf.ca/tag/affiliate-marketing/feed/" rel="self" type="application/rss+xml" />
	<link>http://mattf.ca</link>
	<description>Internet Marketing Dundada</description>
	<lastBuildDate>Mon, 10 May 2010 05:56:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Hide Your Traffic Sources</title>
		<link>http://mattf.ca/php/hide-your-traffic-sources/</link>
		<comments>http://mattf.ca/php/hide-your-traffic-sources/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 08:30:06 +0000</pubDate>
		<dc:creator>Matt Fraser</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Affiliate Marketing]]></category>
		<category><![CDATA[affiliate php]]></category>
		<category><![CDATA[clear referrer]]></category>
		<category><![CDATA[cloaking]]></category>
		<category><![CDATA[referrer]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://mattf.ca/?p=107</guid>
		<description><![CDATA[A simple PHP redirect file that allows for multiple offers.  This will clear the referrer using a double meta refresh.
&#60;?php
// In:    GET_['id']
//        GET_['code']
// Out:    your aff link
//
// Each new case is determined by id
// The Link used is appended with code (for use as subid/keyword)
// Add cases as needed.
// See if refresh has run
$s [...]]]></description>
			<content:encoded><![CDATA[<p>A simple PHP redirect file that allows for multiple offers.  This will clear the referrer using a double meta refresh.</p>
<blockquote><p>&lt;?php<br />
// In:    GET_['id']<br />
//        GET_['code']<br />
// Out:    your aff link<br />
//<br />
// Each new case is determined by id<br />
// The Link used is appended with code (for use as subid/keyword)<br />
// Add cases as needed.<br />
// See if refresh has run<br />
$s = $_GET['s'];<br />
// Get ID to determine campaign<br />
$id = $_GET['id'];<br />
// Get code for keyword tracking<br />
$code = $_GET['code'];<br />
if($s==&#8217;1&#8242;){<br />
if($_SERVER['HTTP_REFERER']==&#8221;"){<br />
// Switch ID case to determine link<br />
switch ($id){<br />
case 1:<br />
$link = &#8220;http://yourafflink.com/1?kw=&#8221;;<br />
break;<br />
case 2:<br />
$link = &#8220;http://yourafflink.com/2?kw=&#8221;;<br />
break;<br />
default:<br />
die(&#8220;Error Processing Request&#8221;);<br />
break;<br />
}<br />
$link = $link.$code;<br />
}else{<br />
die(&#8220;failed to clear&#8221;);<br />
$link = &#8216;http://google.com&#8217;;<br />
}<br />
}else{<br />
$purl=$_SERVER['SCRIPT_NAME'];<br />
$link = $purl.&#8221;?s=1&amp;id=&#8221;.$id.&#8221;&amp;code=&#8221;.$code;<br />
}<br />
// Meta-refresh redirect<br />
?&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;?php<br />
echo &#8220;&lt;meta http-equiv=refresh content=&#8217;0;url=$link&#8217;&gt;&#8221;;<br />
?&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></blockquote>
<p>To add more offers just make more switch cases.  The code variable can be used to track keywords or subids.</p>
<p>usage: http://yourserver.com/file.php?id=[id]&amp;code=[keyword]</p>
<p>Again, it may not be coded best but it seems to work.</p>
]]></content:encoded>
			<wfw:commentRss>http://mattf.ca/php/hide-your-traffic-sources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple PHP Dates</title>
		<link>http://mattf.ca/php/simple-php-dates/</link>
		<comments>http://mattf.ca/php/simple-php-dates/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 21:10:26 +0000</pubDate>
		<dc:creator>Matt Fraser</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Affiliate Marketing]]></category>
		<category><![CDATA[php dates]]></category>
		<category><![CDATA[shotty code]]></category>

		<guid isPermaLink="false">http://mattf.ca/?p=101</guid>
		<description><![CDATA[I&#8217;ve seen people ask how to do future and past dates,  so here&#8217;s what I use.

function doDate($when, $days){
if($when=='past'){
echo date('l, F j, Y', time() - 86400 * $days);
}else if($when=='future'){
echo date('l, F j, Y', time() + 86400 * $days);
}
}
Usage: &#60;?php doDate(&#8216;[past/future]&#8216;,[number of days]); ?&#62;
Example: &#60;?php doDate(&#8216;past&#8217;,3); ?&#62;
This will show a date either in the past or future [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve seen people ask how to do future and past dates,  so here&#8217;s what I use.<br />
<code><br />
function doDate($when, $days){<br />
if($when=='past'){<br />
echo date('l, F j, Y', time() - 86400 * $days);<br />
}else if($when=='future'){<br />
echo date('l, F j, Y', time() + 86400 * $days);<br />
}<br />
}</code></p>
<p>Usage: &lt;?php doDate(&#8216;[past/future]&#8216;,[number of days]); ?&gt;</p>
<p>Example: &lt;?php doDate(&#8216;past&#8217;,3); ?&gt;</p>
<p>This will show a date either in the past or future for whatever days you want.</p>
<p>It gets the job done.</p>
]]></content:encoded>
			<wfw:commentRss>http://mattf.ca/php/simple-php-dates/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
