<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.2" -->
<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/"
	>

<channel>
	<title>Edmonds Commerce Blog</title>
	<link>http://www.edmondscommerce.co.uk/blog</link>
	<description>Web Design, Development, Ecommerce and SEO in the UK</description>
	<pubDate>Wed, 02 Jul 2008 17:54:57 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
	<language>en</language>
			<item>
		<title>Ultimate osCommerce Checkout - Fast and Friendly</title>
		<link>http://www.edmondscommerce.co.uk/blog/php/ultimate-oscommerce-checkout-fast-and-friendly/</link>
		<comments>http://www.edmondscommerce.co.uk/blog/php/ultimate-oscommerce-checkout-fast-and-friendly/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 17:54:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.edmondscommerce.co.uk/blog/php/ultimate-oscommerce-checkout-fast-and-friendly/</guid>
		<description><![CDATA[I have recently completed the second stage of development for my ultimate oscommerce checkout system. This is a replacement for the standard osCommerce checkout which splits into numerous stages, meaning that to actually place an order meant visiting about 5 different pages.
My system rolls every single stage into a single page for entering details and [...]]]></description>
			<content:encoded><![CDATA[<p>I have recently completed the second stage of development for my ultimate oscommerce checkout system. This is a replacement for the standard osCommerce checkout which splits into numerous stages, meaning that to actually place an order meant visiting about 5 different pages.</p>
<p>My system rolls every single stage into a single page for entering details and a subsequent confirmation page simply to allow the customer to double check the details.</p>
<p>I have now finished adding full and detailed AJAX error checking so that as the customer fills out the fast checkout page, their input is checked and validated. If their input is OK the input box turns green, otherwise it turns pinky-red and a red error message box displays telling them exactly what the problem is.</p>
<p>This means that it will be nearly impossible for a customer&#8217;s checkout process to be complicated by breaking one of the oscommerce character limits or making some other error.</p>
<p>If you want your osCommerce checkout to be as fast and userfriendly as possible then you need to sign up for:</p>
<p><strong>Edmonds Commerce Ultimate osCommerce Checkout</strong></p>
<p>Here are a few screen shots of the system running on a client site.</p>
<p><strong>Existing Customer Login</strong></p>
<p>validates email address and checks that the email address is registered</p>
<p><img src="http://www.edmondscommerce.co.uk/blog/wp-content/uploads/2008/07/screenshot-guitar-drums-and-music-shop-playrecordnet-uk-mozilla-firefox.jpg" alt="Existing Customer" /></p>
<p><strong>Validates Inputs</strong></p>
<p>Validates email addresses to help prevent typos and also checks that double entry of email or password matches up.</p>
<p><img src="http://www.edmondscommerce.co.uk/blog/wp-content/uploads/2008/07/screenshot-guitar-drums-and-music-shop-playrecordnet-uk-mozilla-firefox-1.jpg" alt="validate email" /></p>
<p><strong>Set Account, Shipping and Billing Address in One Page</strong></p>
<p>The Fast Checkout system automatically defaults the shipping and billing address to the acccount address. If the customer wants to set another address for either of these, an expandable section allows them to enter a new address or select an existing address book entry. Incorporates full AJAX error checking.</p>
<p><img src="http://www.edmondscommerce.co.uk/blog/wp-content/uploads/2008/07/screenshot-guitar-drums-and-music-shop-playrecordnet-uk-mozilla-firefox-2.jpg" alt="shipping billing address" /></p>
<p><strong>Price </strong></p>
<p>This system can be set up on your site for £997. If you are interested in having the ultimate checkout experience and ensuring that you convert the maximum amount of baskets then<a href="http://www.edmondscommerce.co.uk/contact-about-ultimate-oscommerce-checkout.html" title="Ultimate osCommerce Checkout"> get in touch with Edmonds Commerce today.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.edmondscommerce.co.uk/blog/php/ultimate-oscommerce-checkout-fast-and-friendly/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP Email Attachment Function</title>
		<link>http://www.edmondscommerce.co.uk/blog/php/php-email-attachment-function/</link>
		<comments>http://www.edmondscommerce.co.uk/blog/php/php-email-attachment-function/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 13:02:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[email]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.edmondscommerce.co.uk/blog/php/php-email-attachment-function/</guid>
		<description><![CDATA[Sending an email with PHP is pretty straight forwards. It's very useful for emailing reports generated from cron jobs etc.
Sometimes though you need your application to email an attachment.
After a load of messing around I have hacked together this email attachment PHP function.
PLAIN TEXT
PHP:




function email_attachment&#40;$to_email, $email, $subject,$our_email_name, $our_email, $file_location, $default_filetype='application/zip'&#41;&#123;


&#160; &#160; $email = '&#60;font face=&#34;arial&#34;&#62;' [...]]]></description>
			<content:encoded><![CDATA[<p>Sending an email with PHP is pretty straight forwards. It's very useful for emailing reports generated from cron jobs etc.</p>
<p>Sometimes though you need your application to email an attachment.</p>
<p>After a load of messing around I have hacked together this email attachment PHP function.</p>
<div class="igBar"><span id="lphp-2"><a href="#" onclick="javascript:showPlainTxt('php-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-2">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> email_attachment<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$to_email</span>, <span style="color:#0000FF;">$email</span>, <span style="color:#0000FF;">$subject</span>,<span style="color:#0000FF;">$our_email_name</span>, <span style="color:#0000FF;">$our_email</span>, <span style="color:#0000FF;">$file_location</span>, <span style="color:#0000FF;">$default_filetype</span>=<span style="color:#FF0000;">'application/zip'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$email</span> = <span style="color:#FF0000;">'&lt;font face=&quot;arial&quot;&gt;'</span> . <span style="color:#0000FF;">$email</span> . <span style="color:#FF0000;">'&lt;/font&gt;'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$fileatt</span> = <span style="color:#0000FF;">$file_location</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/function_exists"><span style="color:#000066;">function_exists</span></a><span style="color:#006600; font-weight:bold;">&#40;</span>mime_content_type<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$fileatttype</span> = mime_content_type<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$file_location</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#616100;">else</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$fileatttype</span> = <span style="color:#0000FF;">$default_filetype</span>;;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$fileattname</span> =<a href="http://www.php.net/basename"><span style="color:#000066;">basename</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$file_location</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//prepare attachment</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$file</span> = <a href="http://www.php.net/fopen"><span style="color:#000066;">fopen</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$fileatt</span>, <span style="color:#FF0000;">'rb'</span> <span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$data</span> = <a href="http://www.php.net/fread"><span style="color:#000066;">fread</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$file</span>, <a href="http://www.php.net/filesize"><span style="color:#000066;">filesize</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$fileatt</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/fclose"><span style="color:#000066;">fclose</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$file</span> <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$data</span> = <a href="http://www.php.net/chunk_split"><span style="color:#000066;">chunk_split</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/base64_encode"><span style="color:#000066;">base64_encode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$data</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//create mime boundary</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$semi_rand</span> = <a href="http://www.php.net/md5"><span style="color:#000066;">md5</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/time"><span style="color:#000066;">time</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$mime_boundary</span> = <span style="color:#FF0000;">"==Multipart_Boundary_x{$semi_rand}x"</span>; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//create email&nbsp; section</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$message</span> = <span style="color:#FF0000;">"This is a multi-part message in MIME format.<span style="color:#000099; font-weight:bold;">\n</span><span style="color:#000099; font-weight:bold;">\n</span>"</span> . </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF0000;">"--{$mime_boundary}<span style="color:#000099; font-weight:bold;">\n</span>"</span> . </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF0000;">"Content-type: text/html; charset=us-ascii<span style="color:#000099; font-weight:bold;">\n</span>"</span> . </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF0000;">"Content-Transfer-Encoding: 7bit<span style="color:#000099; font-weight:bold;">\n</span><span style="color:#000099; font-weight:bold;">\n</span>"</span> . </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$email</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\n</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; <span style="color:#FF9933; font-style:italic;">//create attachment section</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$message</span> .= <span style="color:#FF0000;">"--{$mime_boundary}<span style="color:#000099; font-weight:bold;">\n</span>"</span> . </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; <span style="color:#FF0000;">"Content-Type: {$fileatttype};<span style="color:#000099; font-weight:bold;">\n</span>"</span> . </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; <span style="color:#FF0000;">" name=<span style="color:#000099; font-weight:bold;">\"</span>{$fileattname}<span style="color:#000099; font-weight:bold;">\"</span><span style="color:#000099; font-weight:bold;">\n</span>"</span> . </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; <span style="color:#FF0000;">"Content-Disposition: attachment;<span style="color:#000099; font-weight:bold;">\n</span>"</span> . </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; <span style="color:#FF0000;">" filename=<span style="color:#000099; font-weight:bold;">\"</span>{$fileattname}<span style="color:#000099; font-weight:bold;">\"</span><span style="color:#000099; font-weight:bold;">\n</span>"</span> . </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; <span style="color:#FF0000;">"Content-Transfer-Encoding: base64<span style="color:#000099; font-weight:bold;">\n</span><span style="color:#000099; font-weight:bold;">\n</span>"</span> . </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; <span style="color:#0000FF;">$data</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\n</span><span style="color:#000099; font-weight:bold;">\n</span>"</span> . </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; <span style="color:#FF0000;">"--{$mime_boundary}--<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; <span style="color:#FF9933; font-style:italic;">//headers</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$exp</span>=<a href="http://www.php.net/explode"><span style="color:#000066;">explode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'@'</span>, <span style="color:#0000FF;">$our_email</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$domain</span> = <span style="color:#0000FF;">$exp</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$headers</span> = <span style="color:#FF0000;">"From: $our_email_name&lt;$our_email&gt;"</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$headers</span> .= <span style="color:#FF0000;">"Reply-To: $our_email"</span>.<span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$headers</span> .= <span style="color:#FF0000;">"Return-Path: $our_email"</span> . <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\n</span>"</span>;&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// these two to set reply address</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$headers</span> .= <span style="color:#FF0000;">"Message-ID: &lt;"</span>.<a href="http://www.php.net/time"><span style="color:#000066;">time</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#FF0000;">"@"</span> . <span style="color:#0000FF;">$domain</span> . <span style="color:#FF0000;">"&gt;"</span>.<span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$headers</span> .= <span style="color:#FF0000;">"X-Mailer: Edmonds Commerce Email Attachment Function"</span>.<span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\n</span>"</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// These two to help avoid spam-filters</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$headers</span> .= <span style="color:#FF0000;">"Date: "</span>.<a href="http://www.php.net/date"><span style="color:#000066;">date</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"r"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$headers</span> .= <span style="color:#FF0000;">"MIME-Version: 1.0<span style="color:#000099; font-weight:bold;">\n</span>"</span> . </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">"Content-Type: multipart/mixed;<span style="color:#000099; font-weight:bold;">\n</span>"</span> . </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">" boundary=<span style="color:#000099; font-weight:bold;">\"</span>{$mime_boundary}<span style="color:#000099; font-weight:bold;">\"</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/mail"><span style="color:#000066;">mail</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$to_email</span>,<span style="color:#0000FF;">$subject</span>,<span style="color:#0000FF;">$message</span>, <span style="color:#0000FF;">$headers</span>, <span style="color:#FF0000;">'-f '</span> . <span style="color:#0000FF;">$our_email</span><span style="color:#006600; font-weight:bold;">&#41;</span> or <a href="http://www.php.net/die"><span style="color:#000066;">die</span></a> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'&lt;h3 style=&quot;color: red;&quot;&gt;Mail Failed&lt;/h3&gt;'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The PHP and Email Journey Continues <img src='http://www.edmondscommerce.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>For a fully featured <a href="http://www.phpclasses.org/browse/package/2822.html" rel="nofollow">email attachment class</a> this is definitely worth checking out. If you just want a quick function though without any bells and whistles then you should find my function will do the trick.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edmondscommerce.co.uk/blog/php/php-email-attachment-function/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Get Name from Email Address</title>
		<link>http://www.edmondscommerce.co.uk/blog/php/get-name-from-email-address/</link>
		<comments>http://www.edmondscommerce.co.uk/blog/php/get-name-from-email-address/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 12:08:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.edmondscommerce.co.uk/blog/php/get-name-from-email-address/</guid>
		<description><![CDATA[Check out this simple and easy function for extracting the name from an email address. It's not very advanced but it is quite handy. Of course it could be used for similar applications by simply changing the character to split on.
PLAIN TEXT
PHP:




function email_name&#40;$email_address, $split='@'&#41;&#123;


&#160; &#160; return ucwords&#40;strtolower&#40;substr&#40;$email_address, 0, strripos&#40;$email_address, $split&#41;&#41;&#41;&#41;;


&#125; 






There are some very powerful [...]]]></description>
			<content:encoded><![CDATA[<p>Check out this simple and easy function for extracting the name from an email address. It's not very advanced but it is quite handy. Of course it could be used for similar applications by simply changing the character to split on.</p>
<div class="igBar"><span id="lphp-4"><a href="#" onclick="javascript:showPlainTxt('php-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-4">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> email_name<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$email_address</span>, <span style="color:#0000FF;">$split</span>=<span style="color:#FF0000;">'@'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">return</span> <a href="http://www.php.net/ucwords"><span style="color:#000066;">ucwords</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/strtolower"><span style="color:#000066;">strtolower</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/substr"><span style="color:#000066;">substr</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$email_address</span>, <span style="color:#CC66CC;color:#800000;">0</span>, strripos<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$email_address</span>, <span style="color:#0000FF;">$split</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>There are some very powerful things you can do with PHP and email. Check out this <a rel="nofollow" href="http://www.phpclasses.org/browse/package/2.html">POP3 email class</a> for some ideas. I am just starting to scratch the surface of this functionality and will doubtless have some more great things to show soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edmondscommerce.co.uk/blog/php/get-name-from-email-address/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Freelance osCommerce UK</title>
		<link>http://www.edmondscommerce.co.uk/blog/php/freelance-oscommerce-uk/</link>
		<comments>http://www.edmondscommerce.co.uk/blog/php/freelance-oscommerce-uk/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 15:36:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.edmondscommerce.co.uk/blog/php/freelance-oscommerce-uk/</guid>
		<description><![CDATA[It seems that there are many UK webmasters who struggle to find a reliable UK based web developer who specialises in PHP. I have heard stories of people who claim to be osCommerce experts but in reality they simply know how to install a few contributions and that's about it.
If you are looking for a [...]]]></description>
			<content:encoded><![CDATA[<p>It seems that there are many UK webmasters who struggle to find a reliable UK based web developer who specialises in PHP. I have heard stories of people who claim to be osCommerce experts but in reality they simply know how to install a few contributions and that's about it.</p>
<p>If you are looking for a freelance osCommerce developer, especially if you would prefer to deal with someone else in the United Kingdom then you would do well to get in touch with me. I now have a long list of happy clients who have had their osCommerce sites improved, speeded up and automatically populated with huge catalogues.</p>
<p>So to clarify. Edmonds Commerce is a <b>Freelance web developer</b> who specialise in <b>osCommerce</b> and is <b>UK Based</b>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edmondscommerce.co.uk/blog/php/freelance-oscommerce-uk/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP Random Sleep Function with Flush</title>
		<link>http://www.edmondscommerce.co.uk/blog/php/php-random-sleep-function-with-flush/</link>
		<comments>http://www.edmondscommerce.co.uk/blog/php/php-random-sleep-function-with-flush/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 12:50:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[php]]></category>

		<category><![CDATA[scraping]]></category>

		<guid isPermaLink="false">http://www.edmondscommerce.co.uk/blog/php/php-random-sleep-function-with-flush/</guid>
		<description><![CDATA[Sometimes you want your script to pause for a short period of time before repeating a loop or proceeding to the next step. This may be to reduce server load or even to simulate the natural pauses that a person would make whilst browsing a site. This kind of thing is especially true if you [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you want your script to pause for a short period of time before repeating a loop or proceeding to the next step. This may be to reduce server load or even to simulate the natural pauses that a person would make whilst browsing a site. This kind of thing is especially true if you are building a system to scrape content such as product information from a suppliers web site and you do not want to hammer their server to death and get your IP banned.</p>
<div class="igBar"><span id="lphp-6"><a href="#" onclick="javascript:showPlainTxt('php-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-6">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> sleep_flush<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$chunks</span>=<span style="color:#CC66CC;color:#800000;">10</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;<span style="color:#0000FF;">$c</span>=<span style="color:#CC66CC;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;<span style="color:#616100;">while</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$c</span> &lt;<span style="color:#0000FF;">$chunks</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#0000FF;">$rand</span> = <a href="http://www.php.net/rand"><span style="color:#000066;">rand</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">2000000</span>, <span style="color:#CC66CC;color:#800000;">6000000</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;br&gt; . . . sleeping for '</span> . <a href="http://www.php.net/round"><span style="color:#000066;">round</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rand</span> / <span style="color:#CC66CC;color:#800000;">1000000</span><span style="color:#006600; font-weight:bold;">&#41;</span>,<span style="color:#CC66CC;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">' seconds . . . zzzzzzzzzzzzzz&lt;br&gt;'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<a href="http://www.php.net/flush"><span style="color:#000066;">flush</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<a href="http://www.php.net/usleep"><span style="color:#000066;">usleep</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rand</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#0000FF;">$c</span>++;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p> 	</p>
<p>This function will do just that for you. Also it has a built in flush which will help in preventing the script from being regarded as timed out if you are running it from the web browser.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edmondscommerce.co.uk/blog/php/php-random-sleep-function-with-flush/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP 301 Redirect Function with Headers Check and Javascript Fallback</title>
		<link>http://www.edmondscommerce.co.uk/blog/search-engine-optimisation/php-301-redirect-function-with-headers-check-and-javascript-fallback/</link>
		<comments>http://www.edmondscommerce.co.uk/blog/search-engine-optimisation/php-301-redirect-function-with-headers-check-and-javascript-fallback/#comments</comments>
		<pubDate>Thu, 22 May 2008 15:46:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[php]]></category>

		<category><![CDATA[search engine optimisation]]></category>

		<guid isPermaLink="false">http://www.edmondscommerce.co.uk/blog/search-engine-optimisation/php-301-redirect-function-with-headers-check-and-javascript-fallback/</guid>
		<description><![CDATA[If you are changing your URL structure, for example when moving to a search engine friendly URLs system, you need to be able to let Google and all the other search engines that the page has moved to the new URL. You really don't want to display the same content on two URLs
So to achieve [...]]]></description>
			<content:encoded><![CDATA[<p>If you are changing your URL structure, for example when moving to a search engine friendly URLs system, you need to be able to let Google and all the other search engines that the page has moved to the new URL. You really don't want to display the same content on two URLs</p>
<p>So to achieve this we can do what is called a 301 redirect. This is a special redirect message which basically says "has permanently moved to". By doing this, all of the search engine power, rank or whatever you want to call it will be directly transferred to the new URL.</p>
<p><strong>However</strong></p>
<p>Sometimes your script might spit out the headers earlier than you expect. If this happens then your site will fail completely to load with a fatal error along the lines of </p>
<p><strong>warning: Cannot modify header information - headers already sent by (output started at .</strong>...</p>
<p>We really don't want this to happen, so what we can do is wrap the redirection in a headers_sent check and then fall back to a javascript redirect if headers have been sent for some reason. This is belt and braces logic.</p>
<p><i><b>Note script tags need spaces removing</b></i></p>
<div class="igBar"><span id="lphp-8"><a href="#" onclick="javascript:showPlainTxt('php-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-8">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> requrl_check<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$correct_url</span>, <span style="color:#0000FF;">$delay</span>=<span style="color:#CC66CC;color:#800000;">3</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$request_url</span> = <span style="color:#FF0000;">'http://'</span> . <span style="color:#0000FF;">$_SERVER</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'HTTP_HOST'</span><span style="color:#006600; font-weight:bold;">&#93;</span> . <span style="color:#0000FF;">$_SERVER</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'REQUEST_URI'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$request_url</span> != <span style="color:#0000FF;">$correct_url</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span>!<a href="http://www.php.net/headers_sent"><span style="color:#000066;">headers_sent</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#FF9933; font-style:italic;">//going to assume that headers are not sent</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"HTTP/1.1 301 Moved Permanently"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'location: '</span> . <span style="color:#0000FF;">$correct_url</span> . <span style="color:#FF0000;">''</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<a href="http://www.php.net/exit"><span style="color:#000066;">exit</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#616100;">else</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"&lt;h3&gt;The Page $request_url has Moved&lt;/h3&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;"> &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;a href=$correct_url&gt;$correct_url&lt;/a&gt;"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;h3&gt;Now Refreshing in '</span> . <span style="color:#0000FF;">$delay</span> . <span style="color:#FF0000;">' Seconds&lt;/h3&gt;Refreshing to:&lt;br&gt;'</span> . <span style="color:#0000FF;">$correct_url</span> . <span style="color:#FF0000;">'&lt;s c r i p t type=&quot;text/JavaScript&quot;&gt;&lt;!--</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;setTimeout(&quot;location.href = <span style="color:#000099; font-weight:bold;">\'</span>'</span> . <span style="color:#0000FF;">$correct_url</span> . <span style="color:#FF0000;">'<span style="color:#000099; font-weight:bold;">\'</span>;&quot;,'</span> . <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$delay</span> * <span style="color:#CC66CC;color:#800000;">1000</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">');</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;--&gt; &lt;/s c r i p t&gt;'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <a href="http://www.php.net/exit"><span style="color:#000066;">exit</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>tidy <img src='http://www.edmondscommerce.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><b>Further Reading:</b><br />
<a rel="nofollow" href="http://www.stuntdubl.com/2005/09/06/301-redirects/">www.stuntdubl.com</a><br />
<a rel="nofollow" href="http://www.intertwingly.net/blog/911.html">www.intertwingly.ne</a><br />
<a rel="nofollow" href="http://webgasm.actiononline.biz/seo/?p=87">webgasm.actiononline.biz</a><br />
<a rel="nofollow" href="http://www.techcounter.com/seo/permalink-migration-for-a-wordpress-blog-using-a-301-redirect/">www.techcounter.com</a><br />
<a rel="nofollow" href="http://www.chiropractichomepage.com/2007/03/16/chiropractor-web-page-gets-301-redirect/">www.chiropractichomepage.com</a><br />
<a rel="nofollow" href="http://123howtoguide.com/seo/how-to-redirect-a-web-page-using-301-redirect">123howtoguide.com</a><br />
<a rel="nofollow" href="http://searchblog.tamar.com/2007/07/understanding-t.html">searchblog.tamar.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.edmondscommerce.co.uk/blog/search-engine-optimisation/php-301-redirect-function-with-headers-check-and-javascript-fallback/feed/</wfw:commentRss>
		</item>
		<item>
		<title>osCommerce Contribution Released: Server Migration Synchronisation</title>
		<link>http://www.edmondscommerce.co.uk/blog/oscommerce/oscommerce-contribution-released-server-migration-synchronisation/</link>
		<comments>http://www.edmondscommerce.co.uk/blog/oscommerce/oscommerce-contribution-released-server-migration-synchronisation/#comments</comments>
		<pubDate>Wed, 21 May 2008 13:29:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[oscommerce]]></category>

		<guid isPermaLink="false">http://www.edmondscommerce.co.uk/blog/oscommerce/oscommerce-contribution-released-server-migration-synchronisation/</guid>
		<description><![CDATA[Server Migration Orders / Customers Synchronisation
This contribution is for people who have moved or are moving server. When this happens you have to update your DNS records to point your domain name at your new server. However it takes a little bit of time for this change to fully propogate through the internet meaning that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://addons.oscommerce.com/info/5958">Server Migration Orders / Customers Synchronisation</a></p>
<p>This contribution is for people who have moved or are moving server. When this happens you have to update your DNS records to point your domain name at your new server. However it takes a little bit of time for this change to fully propogate through the internet meaning that for a period you will take orders at both servers.</p>
<p>Once your DNS has fully propogated you can use this system to generate a mysql dump of all of the orders/customers on your old site that need to be moved across to the new server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edmondscommerce.co.uk/blog/oscommerce/oscommerce-contribution-released-server-migration-synchronisation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP Generated SQL</title>
		<link>http://www.edmondscommerce.co.uk/blog/mysql/php-generated-sql/</link>
		<comments>http://www.edmondscommerce.co.uk/blog/mysql/php-generated-sql/#comments</comments>
		<pubDate>Wed, 21 May 2008 12:14:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[mysql]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[for]]></category>

		<guid isPermaLink="false">http://www.edmondscommerce.co.uk/blog/mysql/php-generated-sql/</guid>
		<description><![CDATA[If you find yourself laboriously building SQL queries by typing each field = 'value' statement... think again.
Imagine this:
PLAIN TEXT
PHP:




$sql_query = mysql_query&#40;"select * from table"&#41;;


&#160;


$insert_elsewhere_sql = "INSERT INTO other_table SET ";


&#160;


while&#40;$s = mysql_fetch_assoc&#40;$sql_query&#41;&#41;&#123;


&#160; &#160; foreach&#40;$s as $k=&#62;$v&#41;&#123;


&#160; &#160; $insert_elsewhere_sql .= "$k = '$v', ";


&#125;


&#160;


$insert_elsewhere_sql = substr&#40;$insert_elsewhere_sql, 0, -2&#41;; 






This will generate a valid SQL insert statement [...]]]></description>
			<content:encoded><![CDATA[<p>If you find yourself laboriously building SQL queries by typing each field = 'value' statement... think again.</p>
<p>Imagine this:</p>
<div class="igBar"><span id="lphp-10"><a href="#" onclick="javascript:showPlainTxt('php-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-10">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sql_query</span> = <a href="http://www.php.net/mysql_query"><span style="color:#000066;">mysql_query</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"select * from table"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$insert_elsewhere_sql</span> = <span style="color:#FF0000;">"INSERT INTO other_table SET "</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">while</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$s</span> = <a href="http://www.php.net/mysql_fetch_assoc"><span style="color:#000066;">mysql_fetch_assoc</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$sql_query</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$s</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$k</span>=&gt;<span style="color:#0000FF;">$v</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$insert_elsewhere_sql</span> .= <span style="color:#FF0000;">"$k = '$v', "</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$insert_elsewhere_sql</span> = <a href="http://www.php.net/substr"><span style="color:#000066;">substr</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$insert_elsewhere_sql</span>, <span style="color:#CC66CC;color:#800000;">0</span>, -<span style="color:#CC66CC;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>This will generate a valid SQL insert statement with all of your field, value pairs set up.</p>
<p>Time saver or what?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edmondscommerce.co.uk/blog/mysql/php-generated-sql/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Purashop : SEO Services</title>
		<link>http://www.edmondscommerce.co.uk/blog/php/purashop-seo-services/</link>
		<comments>http://www.edmondscommerce.co.uk/blog/php/purashop-seo-services/#comments</comments>
		<pubDate>Wed, 14 May 2008 21:06:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.edmondscommerce.co.uk/blog/php/purashop-seo-services/</guid>
		<description><![CDATA[I am right in the middle of a big SEO overhaul for purashop who have been good clients of mine for a while now.
My initial project for them was a fast checkout system. Getting rid of the standard osCommerce checkout procedure and rolling it all up into a single page which is loads faster, easier [...]]]></description>
			<content:encoded><![CDATA[<p>I am right in the middle of a big SEO overhaul for <a href="http://www.purashop.com">purashop</a> who have been good clients of mine for a while now.</p>
<p>My initial project for them was a fast checkout system. Getting rid of the standard osCommerce checkout procedure and rolling it all up into a single page which is loads faster, easier to use and much more customer friendly.</p>
<p>They have recently asked me to help them out with their search engine optimisation. The first thing I have done is install my bespoke SEO URLs system. This includes product, category and manufacturer SEO URLs. It even includes SEO page urls, no .html?page= for these guys, it's a full static looking URLs system and runs with even less server load than the original oscommerce.</p>
<p>This is a major contrast with the Edmonds Commerce approach to SEO URLs compared with other systems out there. I have seen people who are using systems which dynamically preg_replace every single URL after it has already been generated, adding a huge amount of server load.</p>
<p>The extra icing on the cake though is the SEO URLs search system combined with a search logging system and a <a href="http://www.purashop.com/popular_searches.php">popular searches</a> page. This page is excellent as it is not only a nice resource for customers, but is incredibly search engine friendly. As the content is dictated by the searches performed on the site, the page constantly keeps itself up to date with the latest trends and will constantly optimise their site for the most relevant and active topics of the moment.</p>
<p>I am continuing to tweak and improve their SEO package and have high hopes for a marked improvement in traffic in the not too distant future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edmondscommerce.co.uk/blog/php/purashop-seo-services/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flash and PHP Charts and Graphs</title>
		<link>http://www.edmondscommerce.co.uk/blog/php/flash-and-php-charts-and-graphs/</link>
		<comments>http://www.edmondscommerce.co.uk/blog/php/flash-and-php-charts-and-graphs/#comments</comments>
		<pubDate>Wed, 14 May 2008 08:47:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[flash]]></category>

		<category><![CDATA[gd]]></category>

		<category><![CDATA[graphs]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.edmondscommerce.co.uk/blog/php/flash-and-php-charts-and-graphs/</guid>
		<description><![CDATA[It is entirely possible and easy enough to create all kinds of charts and graphs using only PHP along with the GD library. 
These days PHP is generally compiled with the GD library enabled so it is highly likely that you already have access to it. It is a powerful system, unfortunately often only used [...]]]></description>
			<content:encoded><![CDATA[<p>It is entirely possible and easy enough to create all kinds of charts and graphs using only PHP along with the GD library. </p>
<p>These days PHP is generally compiled with the GD library enabled so it is highly likely that you already have access to it. It is a powerful system, unfortunately often only used for creating thumbnail images.</p>
<p>For building management information systems with real time generated graphs there are some excellent classes available which will help you display information in a graphical and therefore easier to understand manner. </p>
<p>Checkout these great free graph classes:</p>
<p><a href="http://www.phpclasses.org/browse/package/4299.html" rel="nofollow">Class: Google Graph</a><br />
<a href="http://www.phpclasses.org/browse/package/1567.html" rel="nofollow">Class: Bar Graph generator</a><br />
<a href="http://www.phpclasses.org/browse/package/176.htmll" rel="nofollow">Class: Graph Drawing Class 2</a></p>
<p>However, sometime the graphics produced by GD simply are not flash enough for your application. </p>
<p>When you want something really flashy on your web site then you really can't go wrong using flash.</p>
<p>There are a few flash graph packages you can purchase online for not too much cash. However if you prefer to keep it all open source then I highly recommend checking out this open source flash graph class.</p>
<p><a href="http://teethgrinder.co.uk/open-flash-chart/index.php" rel="nofollow">Open Flash Chart project</a></p>
<p><b>Further Reading:</b></p>
<p><a rel="nofollow" href="http://noteplog.com/flash-graphs-open-source-charts/">noteplog.com</a><br />
<a rel="nofollow" href="http://bivald.com/lessons-learned/2007/07/double-yaxis-contribution-incl.html">bivald.com</a><br />
<a rel="nofollow" href="http://blogs.sun.com/bdonovan/entry/adding_an_openflash_chart_to">blogs.sun.com</a><br />
<a rel="nofollow" href="http://www.webappers.com/2007/12/27/open-flash-chart-flash-charting-component-for-free/">www.webappers.com</a><br />
<a rel="nofollow" href="http://blogulate.com/content/great-looking-charts-in-seconds-with-open-flash-chart/">blogulate.com</a><br />
<a rel="nofollow" href="http://www.linewbie.com/2007/11/create-impressive-charts-with-open-flash-chart.html">www.linewbie.com</a><br />
<a rel="nofollow" href="http://hotware.wordpress.com/2008/04/21/open-flash-chart-a-free-flash-based-charting-solution/">hotware.wordpress.com</a><br />
<a rel="nofollow" href="http://wordpress.designpraxis.at/2007/11/04/open-source-flash-chart-library/">wordpress.designpraxis.at</a><br />
<a rel="nofollow" href="http://www.stat.columbia.edu/~cook/movabletype/archives/2007/10/how_to_make_a_c.html">www.stat.columbia.edu</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.edmondscommerce.co.uk/blog/php/flash-and-php-charts-and-graphs/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
