<?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>Carbonized Blog &#187; Web Development</title>
	<atom:link href="http://carbonize.co.uk/wp/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://carbonize.co.uk/wp</link>
	<description>Just a bunch of stuff</description>
	<lastBuildDate>Fri, 25 Nov 2011 19:24:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Sending email via SMTP using PHP</title>
		<link>http://carbonize.co.uk/wp/2011/10/24/sending-email-via-smtp-using-php/</link>
		<comments>http://carbonize.co.uk/wp/2011/10/24/sending-email-via-smtp-using-php/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 11:08:51 +0000</pubDate>
		<dc:creator>Carbonize</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://carbonize.co.uk/wp/?p=472</guid>
		<description><![CDATA[<a href="http://carbonize.co.uk/wp/2011/10/24/sending-email-via-smtp-using-php/" title="Sending email via SMTP using PHP"></a>A couple of my users contacted me to say that their host had disabled sendmail and required any scripts they use to now use SMTP to send emails. This resulted in me quickly reading all I could about SMTP and &#8230;<p class="read-more"><a href="http://carbonize.co.uk/wp/2011/10/24/sending-email-via-smtp-using-php/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://carbonize.co.uk/wp/2011/10/24/sending-email-via-smtp-using-php/" title="Sending email via SMTP using PHP"></a><p>A couple of my users contacted me to say that their host had disabled sendmail and required any scripts they use to now use SMTP to send emails. This resulted in me quickly reading all I could about SMTP and the result is this slightly rough script I am sharing. It&#8217;s pretty self explanatory. Put your SMTP server details in the $mailCfg array. Next simply call the smtpMail function which uses the same variables as the standard PHP mail() function but with two additional variables. The additional variables are the email address we are sending from and $mailCfg. I could of put $mailCfg as a global but this way you can include the script in a different script and store the required information where ever you want. The from address is important as most SMTP servers will reject the message if it&#8217;s not included.</p>
<p>Just remember the code is far from perfect and was created to do a simple job.</p>
<p>It also has one nice extra function you might find useful&#8230; <span id="more-472"></span></p>
<p>The directMail function will look up the recipients SMTP server and try to deliver the email directly to it thereby bypassing the need for you to have access to an SMTP server to send through. Just remember your host may frown upon the use of this function.</p>
<pre class="brush: php">&lt;?php
/*
 * SMTP Email Sending
 * By Stewart Souter
 * Date Created: Thurs, 11 August 2011 17:15:37 GMT
 * Last Updated: Fri, 19 August 2011 10:54:35 GMT
 * email: webmaster@carbonize.co.uk
 *
 * By using this script you are agreeing to leave this
 * comment and agreement in place and untouched. If you
 * use any part of this code you must make it clear where
 * it came from and give credit where it is due.
 */

$mailCfg[&#039;Server&#039;]    = &#039;&#039;;    // Servername
$mailCfg[&#039;User&#039;]      = &#039;&#039;;    // SMTP username if needed
$mailCfg[&#039;Pass&#039;]      = &#039;&#039;;    // SMTP Password if needed
$mailCfg[&#039;Port&#039;]      = 25;    // SMTP server port. 25 is the usual and 465 if using SSL
$mailCfg[&#039;popServer&#039;] = &#039;&#039;;    // Name of the pop server. Leave empty if POP Auth not required
$mailCfg[&#039;popPort&#039;]   = 110;   // Port for the pop server. 110 is the usual and 995 if using SSL
$mailCfg[&#039;SSL&#039;]       = 0;     // Does your SMTP server need you to use SSL or TLS? 0 = no, 1 = SSL, 2 = TLS

// This function delivers the email directly to the recipients mail server so bypassing the need for your own
function directMail($mailTo, $mailSubject, $mailMsg, $mailHeaders = &#039;&#039;, $mailFrom = &#039;&#039;, $mailCfg)
{
  if(empty($mailFrom))
  {
    return false; // No from address == no sending
  }
  $mailParts = explode(&#039;@&#039;, $mailTo);  // Seperate the parts of the email address
  @getmxrr($mailParts[1], $mxHosts, $mxWeight); // Get the MX records for the emails domain
  for($i=0;$i&lt;count($mxHosts);$i++) // Put the records and weights into an array
  {
      $mxServers[$mxHosts[$i]] = $mxWeight[$i];
  }
  asort($mxServers); // Sort the array so they are in weighted order
  foreach($mxServers as $key =&gt; $value)
  {
    $mailCfg[&#039;Server&#039;] = $key; // Set the SMTP server to the current MX record
    if(smtpMail($mailTo, $mailSubject, $mailMsg, $mailHeaders, $mailFrom, $mailCfg)) // Send the email using the MX server
    {
      return true;  // The email was successfully sent
    }
  }
  return false;  // Houston we have a problem
}

// This function connects to the SMTP server and does the AUTH if needed. Can also do a POP login if server requires that.
function smtpMail($mailTo, $mailSubject, $mailMsg, $mailHeaders = &#039;&#039;, $mailFrom = &#039;&#039;, $mailCfg )
{
  if(empty($mailFrom))
  {
    return false; // No from address == no sending
  }
  $timeout = &#039;30&#039;; // How long to keep trying to connect
  $localhost = &#039;localhost&#039;; // How to identify ourselves
  $logArray = array(); // For storing the replies

  /* * * * POP Login if required * * */ 

  if(!empty($mailCfg[&#039;popServer&#039;])) // Can&#039;t really do POP Auth without a server
  {
    $ssl = ($mailCfg[&#039;SSL&#039;] != 0) ? (($mailCfg[&#039;SSL&#039;] == 1) ? &#039;ssl://&#039; : &#039;tls://&#039;) : &#039;&#039;; // If SSL or TLS add it
    $popConnect = @fsockopen($ssl.$mailCfg[&#039;popServer&#039;], $mailCfg[&#039;popPort&#039;], $errno, $errstr, $timeout); // Connect
    if(!$popConnect) // If we fail to connect...
    {
      $logArray[&#039;POPconnect&#039;] = $errstr . &#039;(&#039; . $errno . &#039;)&#039;; // Log the given reason...
      logMailError($logArray); // And output to the log file.
      return false;
    }
    else
    {
      $logArray[&#039;POPconnect&#039;] = @fgets($popConnect, 515)); // POP servers only return single line replies. Or should.
      if(!mailPackets(&#039;AUTH LOGIN&#039;, $popConnect, &#039;SMTPauth&#039;)) //Request Auth Login
      {
        return false;
      }
      if(!mailPackets(&#039;USER &#039; . $smtpUser, $popConnect, &#039;POPuser&#039;)) // Send username. POP is plaintext
      {
        return false;
      }
      if(!mailPackets(&#039;PASS &#039; . $smtpPass, $popConnect, &#039;POPpass&#039;)) // Send password, again in plaintext
      {
        return false;
      }
      if(!mailPackets(&#039;QUIT&#039;, $popConnect, &#039;POPquit&#039;)) // Say bye to the server
      {
        return false;
      }
      fclose($popConnect); // Close connection
    }
  }

  /* * * * End of POP Login * * * * */

  /* * * * Start of SMTP stuff * * * */

  $ssl = ($mailCfg[&#039;SSL&#039;] != 0) ? (($mailCfg[&#039;SSL&#039;] == 1) ? &#039;ssl://&#039; : &#039;tls://&#039;) : &#039;&#039;; // Set the encryption if needed
  $smtpConnect = @fsockopen($ssl.$mailCfg[&#039;Server&#039;], $mailCfg[&#039;Port&#039;], $errno, $errstr, $timeout); // Connect
  if(!$smtpConnect) // If we fail to connect...
  {
    $logArray[&#039;SMTPconnect&#039;] = $errstr . &#039;(&#039; . $errno . &#039;)&#039;; // Add the reason to the log...
    logMailError($logArray); // Then output the log
    return false;
  }
  else
  {
    $cnectKey = 0; // A counter for when we receive multiple lines in reply
    do
    {
      $smtpResponse = @fgets($smtpConnect, 515); // Get the reply
      $cnectKey++; // Increment the counter
      $logArray[&#039;SMTPconnect&#039; . $cnectKey] = $smtpResponse; // Log the response
      $responseCode = substr($smtpResponse, 0, 3); // Grab the response code from start of the response
      // If we get an error terminate the connection and log the results so far
      if($responseCode &gt;= 400)
      {
        logMailError($logArray, $smtpConnect);
        return false;
      }
    }
    while((strlen($smtpResponse) &gt; 3) &amp;&amp; (strpos($smtpResponse, &#039; &#039;) != 3)); // Loop until we get told it&#039;s the last line
      $ehlo = mailPackets(&#039;EHLO &#039; . $localhost, $smtpConnect, $logArray, &#039;SMTPehlo&#039;); // Let&#039;s try using EHLO first
      if($ehlo != 250) // Server said it didn&#039;t like EHLO so drop back to HELO
      {
        if(!mailPackets(&#039;HELO &#039; . $localhost, $smtpConnect, $logArray, &#039;SMTPhelo&#039;)) // Send HELO. No EHLO means server doesn&#039;t support AUTH
        {
          return false;
        }
      }
      if(!empty($mailCfg[&#039;User&#039;]) &amp;&amp; ($ehlo == 250)) // We have a username and server supports EHLO so send login credentials
      {
        if(!mailPackets(&#039;AUTH LOGIN&#039;, $smtpConnect, $logArray, &#039;SMTPauth&#039;)) // Request Auth Login
        {
          return false;
        }
        if(!mailPackets(base64_encode($mailCfg[&#039;User&#039;]), $smtpConnect, $logArray, &#039;SMTPuser&#039;)) // Send username
        {
          return false;
        }
        if(!mailPackets(base64_encode($mailCfg[&#039;Pass&#039;]), $smtpConnect, $logArray, &#039;SMTPpass&#039;)) // Send password
        {
          return false;
        }
      }
      if(!mailPackets(&#039;MAIL FROM:&lt;&#039; . $mailFrom . &#039;&gt;&#039;, $smtpConnect, $logArray, &#039;SMTPfrom&#039;)) // Email From
      {
        return false;
      }
      if(!mailPackets(&#039;RCPT TO:&lt;&#039; . $mailTo . &#039;&gt;&#039;, $smtpConnect, $logArray, &#039;SMTPrcpt&#039;)) // Email To
      {
        return false;
      }
      if(!mailPackets(&#039;DATA&#039;, $smtpConnect, $logArray, &#039;SMTPmsg&#039;)) // We are about to send the message
      {
        return false;
      }
      // First lets make sure both the message and additional headers do not contain anythign that might be seen as end of message marker
      $mailMsg = preg_replace(array(&quot;/(?&lt;!\r)\n/&quot;, &quot;/\r(?!\n)/&quot;, &quot;/\r\n\./&quot;), array(&quot;\r\n&quot;, &quot;\r\n&quot;, &quot;\r\n..&quot;), $mailMsg);
      $mailHeaders = (!empty($mailHeaders)) ? &quot;\r\n&quot; . preg_replace(array(&quot;/(?&lt;!\r)\n/&quot;, &quot;/\r(?!\n)/&quot;, &quot;/\r\n\./&quot;), array(&quot;\r\n&quot;, &quot;\r\n&quot;, &quot;\r\n..&quot;), $mailHeaders) : &#039;&#039;;
      // Create the default headers, attach any additonal headers
      $mailHeaders = &quot;To: &lt;&quot;.$mailCfg[&#039;To&#039;].&quot;&gt;\r\nFrom: &lt;&quot;.$mailCfg[&#039;From&#039;].&quot;&gt;\r\nSubject: &quot;.$mailCfg[&#039;Subject&#039;].&quot;\r\nDate: &quot; . gmdate(&#039;D, d M Y H:i:s&#039;) . &quot; -0000&quot;.$mailHeaders;
      if(!mailPackets($mailHeaders.&quot;\r\n\r\n&quot;.$mailMsg.&quot;\r\n.&quot;, $smtpConnect, $logArray, &#039;SMTPbody&#039;)) // The message
      {
        return false;
      }
      mailPackets(&#039;QUIT&#039;, $smtpConnect, $logArray, &#039;SMTPquit&#039;); // Say Bye to SMTP server
      fclose($smtpConnect); // Be nice and close the connection
      return true; // Return the fact we sent the message
  }
}

// This function sends the actual packets then logs the reponses and parses the reponse code
function mailPackets($sendStr,$mailConnect,&amp;$logArray,$logName = &#039;&#039;)
{
  $newLine = &quot;\r\n&quot;; // LEAVE THIS ALONE
  $keyCount = 0;  // Just an incremental counter for when we get more than a single line response
  @fputs($mailConnect,$sendStr . $newLine); // Send the packet
  do // Start grabbing the responses until we either get a terminal error or told we are at the end
  {
    $mailResponse = @fgets($mailConnect, 515); // Receive the response
    $keyCount++; // Incrememnt the key count
    $logArray[$logName . $keyCount] = $mailResponse; // Put the response in to the log array
    $responseCode = substr($smtpResponse, 0, 3); // Grab the response code from start of the response
    // Check for error codes except on ehlo, auth, and user details as they are not always fatal
    if((($logName != &#039;SMTPauth&#039;) &amp;&amp; ($logName != &#039;SMTPuser&#039;) &amp;&amp; ($logName != &#039;SMTPehlo&#039;) &amp;&amp; ($logName != &#039;SMTPpass&#039;)) &amp;&amp; ($responseCode &gt;= 400))
    {
       logMailError($logArray,$mailConnect);
       return false;
    }
    elseif((substr($responseCode, 0, 1) == 4) || ($responseCode &gt;= 521) &amp;&amp; ($logName != &#039;SMTPehlo&#039;))
    {
       logMailError($logArray,$mailConnect);
       return false;
    }
  }
  while((strlen($mailResponse) &gt; 3) &amp;&amp; (strpos($mailResponse, &#039; &#039;) != 3)); // Loop until we get the end response
  return $responseCode; // Return the response code
}

function logMailError(&amp;$logArray, $mailServer = false)
{
  if($mailServer)
  {
    fclose($mailServer); // Be nice and close the connection
  }
  $fd = @fopen (&#039;smtplog.txt&#039;, &#039;a&#039;); // open the log file
  $mailResults = print_r($logArray, true); // Create a nice printable version of logArray
  @fwrite($fd,$mailResults); // Write the log
  @fclose ($fd); // Close the file
}

?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://carbonize.co.uk/wp/2011/10/24/sending-email-via-smtp-using-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Safari 4 and Firefox 3.5b99</title>
		<link>http://carbonize.co.uk/wp/2009/06/09/safari-4-and-firefox-35b99/</link>
		<comments>http://carbonize.co.uk/wp/2009/06/09/safari-4-and-firefox-35b99/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 15:21:26 +0000</pubDate>
		<dc:creator>Carbonize</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Flock]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[web browsers]]></category>

		<guid isPermaLink="false">http://carbonize.co.uk/wp/2009/06/09/safari-4-and-firefox-35b99/</guid>
		<description><![CDATA[<a href="http://carbonize.co.uk/wp/2009/06/09/safari-4-and-firefox-35b99/" title="Safari 4 and Firefox 3.5b99"></a>Well Apple has gone and released the memory hog that is Safari 4. It does look good but given that it uses a ridiculous amount of memory I think I will pass. It has some nice features that only work &#8230;<p class="read-more"><a href="http://carbonize.co.uk/wp/2009/06/09/safari-4-and-firefox-35b99/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://carbonize.co.uk/wp/2009/06/09/safari-4-and-firefox-35b99/" title="Safari 4 and Firefox 3.5b99"></a><p>Well Apple has gone and released the memory hog that is <a  href="http://apple.com/safari" target="_blank">Safari 4</a>. It does look good but given that it uses a ridiculous amount of memory I think I will pass. It has some nice features that only work on a mac. Go figure.</p>
<p>Also Mozilla has released a new version of <a  href="http://mozilla.com" target="_blank">Firefox 3.5</a>. It is marked as beta 99 but is basically something between a beta and a release candidate. it has improvements to Tracemonkey, the engine used to clean up memory usage but not sure it works that good at removing things from memory it no longer requires.</p>
<p>Now <a  href="http://www.google.com/chrome" target="_blank">Google Chrome</a> has excellent memory handling it&#8217;s just a shame it&#8217;s options are sparse, <del datetime="2009-06-12T20:30:57+00:00">it has no extension support (even IE supports extensions/plug ins)</del> (apparently as of version 2 it does) and the rendering engine, WebKit, is far from perfect. Sites like Facebook can prove a nightmare at times when it&#8217;s divs disappear behind it&#8217;s ad bar.</p>
<p>I&#8217;ve personally decided to give Firefox a break and use <a  href="http://flock.com" target="_blank">Flock</a> for a few weeks.</p>
]]></content:encoded>
			<wfw:commentRss>http://carbonize.co.uk/wp/2009/06/09/safari-4-and-firefox-35b99/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Blocking IP Addresses Using htaccess</title>
		<link>http://carbonize.co.uk/wp/2009/05/15/blocking-ip-addresses-using-htaccess/</link>
		<comments>http://carbonize.co.uk/wp/2009/05/15/blocking-ip-addresses-using-htaccess/#comments</comments>
		<pubDate>Fri, 15 May 2009 12:26:27 +0000</pubDate>
		<dc:creator>Carbonize</dc:creator>
				<category><![CDATA[spam]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Script Kiddies]]></category>
		<category><![CDATA[spammers]]></category>

		<guid isPermaLink="false">http://carbonize.co.uk/wp/?p=267</guid>
		<description><![CDATA[<a href="http://carbonize.co.uk/wp/2009/05/15/blocking-ip-addresses-using-htaccess/" title="Blocking IP Addresses Using htaccess"></a>I&#8217;m writing this because blocking by domain on my hosts pretty much kills my web site and so I have had to learn to block ip addresses. Blocking single ip addresses is simple as you just need something like the &#8230;<p class="read-more"><a href="http://carbonize.co.uk/wp/2009/05/15/blocking-ip-addresses-using-htaccess/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://carbonize.co.uk/wp/2009/05/15/blocking-ip-addresses-using-htaccess/" title="Blocking IP Addresses Using htaccess"></a><p>I&#8217;m writing this because blocking by domain on my hosts pretty much kills my web site and so I have had to learn to block ip addresses. Blocking single ip addresses is simple as you just need something like the following</p>
<p> order allow,deny<br />
 deny from 9.120.161.206<br />
 allow from all</p>
<p>And that will block the computer at ip address 9.120.161.206 from being able to access your site. But what if you want to block a whole range of ip addresses such as 9.120.161.0 to 9.120.161.255? Well then we just leave off the end number like this</p>
<p> order allow,deny<br />
 deny from 9.120.161.<br />
 allow from all</p>
<p>Ok so now we get to the clever and damn fiddly bit. As of Apache 1.3 we can use <acronym title="Classless Inter-Domain Routing">CIDR</acronym> codes to specify ranges of ip addresses. So another way of writing the above code would be</p>
<p> order allow,deny<br />
 deny from 9.120.161.0/24<br />
 allow from all</p>
<p>and that would do exactly the same as 9.120.161. but we can do so much more. After the break (ie click the read more link) I will show a list of the CIDR codes and what they do.<br />
<span id="more-267"></span><br />
Ok first thing we need to do is explain that CIDR goes from 0 to 32. 0 covers every possible ip address, all 4,294,967,296 of them so doesn&#8217;t really get used much. As CIDR is based on bits the number of ip addresses blocked doubles as we go down the list.</p>
<p>32 only block the single ip address so is a bit pointless<br />
31 blocks 2 address so would block 127.0.0.1 and 127.0.0.2. Could just as easily be like 127.0.0.19/31 as you can start from any ip address<br />
30 blocks 4 ip address so 127.0.0.1 to 127.0.0.4<br />
29 blocks 8 ip address so 127.0.0.1/29 would block 127.0.0.1 to 127.0.0.8 (starting to see a pattern?)<br />
28 down to 25 I&#8217;m sure you can figure out. It&#8217;s from 24 it gets interesting.<br />
24 blocks a whole sub set of ip addresses (thats 256 addresses) so we can use 127.0.0.0/24 to block 127.0.0.0 to 127.0.0.255<br />
23 blocks 512 address so that&#8217;s 2 entire subsets. 127.0.0.0/23 would block 127.0.0.0 to 127.0.1.255<br />
22 is 1024 addresses or 4 sub sets<br />
21 is 2048 or 8 sub sets<br />
20 is 4096 address or 16 sub sets (like 127.0.0.0 to 127.0.15.255)<br />
19 would be 8192 address so 32 sub sets. I used this one when blocking keyweb.de servers<br />
18 is 16384 or 64 sub sets<br />
17 equals 32768 addresses and I used it to block some layeredtech<br />
16 is the lowest CIDR code I have used and that covers 65536 addresses or 256 sub sets. This is again used to block LayeredTech.</p>
<p>I&#8217;m pretty sure you can work the rest out for yourself from here on. I got my information from <a  href="http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing" target="_blank">this Wikipedia entry</a>. I will now post a couple I have used in my own htaccess and say why.</p>
<p> # These two are for layeredtech. Well known friend to spammers.<br />
 deny from 72.232.0.0/16<br />
 deny from 72.233.0.0/17<br />
 # Keyweb.de servers. Plenty of spam attempts from them<br />
 deny from 87.118.96.0/19<br />
 # Dragonara.net just started getting spam attempts from them<br />
 deny from 194.8.74.0/23</p>
]]></content:encoded>
			<wfw:commentRss>http://carbonize.co.uk/wp/2009/05/15/blocking-ip-addresses-using-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top Ten Javascript Functions</title>
		<link>http://carbonize.co.uk/wp/2009/04/28/top-ten-javascript-functions/</link>
		<comments>http://carbonize.co.uk/wp/2009/04/28/top-ten-javascript-functions/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 04:13:07 +0000</pubDate>
		<dc:creator>Carbonize</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://carbonize.co.uk/wp/?p=260</guid>
		<description><![CDATA[<a href="http://carbonize.co.uk/wp/2009/04/28/top-ten-javascript-functions/" title="Top Ten Javascript Functions"></a>Whilst surfing the ether we call the internet I came across a list of top ten javascript functions by Dustin Diaz. As the saying goes it does exactly what it says on the tin. It is a collection of ten &#8230;<p class="read-more"><a href="http://carbonize.co.uk/wp/2009/04/28/top-ten-javascript-functions/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://carbonize.co.uk/wp/2009/04/28/top-ten-javascript-functions/" title="Top Ten Javascript Functions"></a><p>Whilst surfing the ether we call the internet I came across a list of <a  href="http://www.dustindiaz.com/top-ten-javascript/" target="_blank">top ten javascript functions</a> by Dustin Diaz. As the saying goes it does exactly what it says on the tin. It is a collection of ten (and a bonus one) basic javascript functions that most Javascript writers will need/use quite a lot. Such functions as adding onload events to the window even if you&#8217;re not sure that it&#8217;s already been set by another script. getElementByClass which to me is something that should of been in Javascript from the start <img src='http://carbonize.co.uk/wp/wp-includes/images/smilies/icon_mad.gif' alt=':mad:' class='wp-smiley' />  . If you write Javascript then you will find atleast one of the functions useful.</p>
<p>And I know it was written in 2005 but the functions are just as valid today.</p>
]]></content:encoded>
			<wfw:commentRss>http://carbonize.co.uk/wp/2009/04/28/top-ten-javascript-functions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Rising Antivirus Review</title>
		<link>http://carbonize.co.uk/wp/2009/04/19/rising-antivirus/</link>
		<comments>http://carbonize.co.uk/wp/2009/04/19/rising-antivirus/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 16:09:14 +0000</pubDate>
		<dc:creator>Carbonize</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[reviews]]></category>
		<category><![CDATA[Site]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[anti virus]]></category>
		<category><![CDATA[viruses]]></category>

		<guid isPermaLink="false">http://carbonize.co.uk/wp/?p=254</guid>
		<description><![CDATA[<a href="http://carbonize.co.uk/wp/2009/04/19/rising-antivirus/" title="Rising Antivirus Review"></a>I recently decided to try / review a new anti virus program I had heard about called Rising Antivirus. Now my first issue with this anti virus is the fact that the installer is over 60MB and the download was &#8230;<p class="read-more"><a href="http://carbonize.co.uk/wp/2009/04/19/rising-antivirus/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://carbonize.co.uk/wp/2009/04/19/rising-antivirus/" title="Rising Antivirus Review"></a><p>I recently decided to try /  review a new anti virus program I had heard about called <a  href="http://www.rising-global.com/" target="_blank">Rising Antivirus</a>. Now my first issue with this anti virus is the fact that the installer is over 60MB and the download was slow as hell. Took me around 30 minutes to download and I&#8217;m on a 20Mb connection. Once installed it takes over 200MB of hard drive space. First thing I did was run an update and it seemed to me that every component had an update and given I had only just downloaded the program this seems excessive. Next I ran a scan of the local drives. After twenty minutes I stopped it as it had only done about 5% and was saying it had over an hour left to go. Given this was my laptop with little on it this was far from acceptible.</p>
<p>Now we get to the main reason I swiftly uninstalled it. I downloaded the <a  href="http://www.eicar.org/anti_virus_test_file.htm" target="_blank">Eicar test file</a> which is a standard file that all antivirus programs recognise as a test file so you can test if your antivirus is working or not. So I put the eicar.com file on my desktop and ran it. Rising Antivirus did absolutely nothing. I can accept it not detecting it during the download because my favourite free antivirus, <a  href="http://freeav.com" targe="_blank">AntiVir</a>, only scans files when they are opened or read. To not detect the test file when run makes me wonder what else it doesn&#8217;t detect. I told it to scan the eicar.com file and it alerted me that it was a virus (well a test file which is what it should report it as) but not even a beep from Rising Antivirus when I run the file. In fact I had to turn Rising&#8217;s detection level up to high to get it to report it as a virus when I opened it. Even then I could see the command window in the background that eicar.com opens so I&#8217;m not even sure that if it had been a virus Rising Antivirus would of stopped it doing anything.</p>
<p>So my advice is avoid this anti virus like the plague. The best free anti virus, in my opinion, is AntiVir and the next best free one is <a  href="http://avast.com" target="_blank">Avast</a>. I can no longer even recommend AVG as third place because all reports say as of version 8 AVG has become a resource hog that slows your computer down.</p>
]]></content:encoded>
			<wfw:commentRss>http://carbonize.co.uk/wp/2009/04/19/rising-antivirus/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Bad Web Devs</title>
		<link>http://carbonize.co.uk/wp/2009/03/30/bad-web-devs/</link>
		<comments>http://carbonize.co.uk/wp/2009/03/30/bad-web-devs/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 20:56:32 +0000</pubDate>
		<dc:creator>Carbonize</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[web browsers]]></category>

		<guid isPermaLink="false">http://carbonize.co.uk/wp/?p=237</guid>
		<description><![CDATA[<a href="http://carbonize.co.uk/wp/2009/03/30/bad-web-devs/" title="Bad Web Devs"></a>I&#8217;m a hobbyist web developer and nothing annoys me more than web sites that have obviously paid for someone to build their sites but whoever has built it has done a half arsed job. My main gripe at the moment &#8230;<p class="read-more"><a href="http://carbonize.co.uk/wp/2009/03/30/bad-web-devs/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://carbonize.co.uk/wp/2009/03/30/bad-web-devs/" title="Bad Web Devs"></a><p>I&#8217;m a hobbyist web developer and nothing annoys me more than web sites that have obviously paid for someone to build their sites but whoever has built it has done a half arsed job. </p>
<p>My main gripe at the moment is sites that require you to have cookies enabled but have terrible code in place for if you don&#8217;t.</p>
<p>A good example is <a  href="http://game.co.uk" target="_blank">Game</a> who put you in to an infinite redirect loop if you have cookies disabled. In fact you have to enable cookies on their site to see the page that tells you that you needs cookies enabled to view the site <img src='http://carbonize.co.uk/wp/wp-includes/images/smilies/icon_neutral.gif' alt=':|' class='wp-smiley' /> </p>
<p>Another bad one I just found, and this one is really really bad, is <a  href="http://download.cnet.com/windows/" target="_blank">download.com</a>. You don&#8217;t need cookies to view the site but if you have them disabled and click through to view a programs page your browsers memory usage goes through the roof. I tested this in Firefox 3.1 b3, IE8 and Chrome. With all three browsers I had to use task manager to close them thanks to download.com&#8217;s sloppy web code.</p>
<p>So please, if you are going to write a site that requires that visitors accept cookies, make sure you have good code in place to handle people like me who have cookies disabled.</p>
]]></content:encoded>
			<wfw:commentRss>http://carbonize.co.uk/wp/2009/03/30/bad-web-devs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Browser Wars</title>
		<link>http://carbonize.co.uk/wp/2009/03/18/browser-wars/</link>
		<comments>http://carbonize.co.uk/wp/2009/03/18/browser-wars/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 19:02:29 +0000</pubDate>
		<dc:creator>Carbonize</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Safari]]></category>

		<guid isPermaLink="false">http://carbonize.co.uk/wp/?p=186</guid>
		<description><![CDATA[<a href="http://carbonize.co.uk/wp/2009/03/18/browser-wars/" title="Browser Wars"></a>OK thanks to Google&#8217;s Chrome and Apple now making Safari a serious browser for Windows the browser war is getting ridiculous. They all seem obsessed with how fast their Javascript engines run with Google now saying the V8 engine in &#8230;<p class="read-more"><a href="http://carbonize.co.uk/wp/2009/03/18/browser-wars/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://carbonize.co.uk/wp/2009/03/18/browser-wars/" title="Browser Wars"></a><p>OK thanks to Google&#8217;s Chrome and Apple now making Safari a serious browser for Windows the browser war is getting ridiculous. They all seem obsessed with how fast their Javascript engines run with Google now saying the V8 engine in Chrome 2 is 25% faster than in Chrome 1. Who cares? The speed of the Javascript engines is now so fast few people if any would be able to notice a difference in everyday use. The only people who are are Geeks who think the extra milliseconds make all the difference.</p>
<p>I&#8217;m not interested in how fast their Javascript engines run I just want a browser that is configurable and doesn&#8217;t eat up resources. I&#8217;m sticking with Firefox at present as it lets me configure cookies exactly how I want and has some sweet extensions. I am impressed with the WebKit engine as used in Chrome and Safari. To me Opera fell to the wayside with version 7. So at some point I may switch from Firefox to Safari or Chrome but can&#8217;t see it anytime soon. Safari 4 beta looks good but is all eye candy and eats memory. Chrome is to basic with very limited options and no black/white list for cookies. Safari also has neither a whitelist nor blacklist.</p>
]]></content:encoded>
			<wfw:commentRss>http://carbonize.co.uk/wp/2009/03/18/browser-wars/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Gzipping your pages to save bandwidth</title>
		<link>http://carbonize.co.uk/wp/2009/02/13/gzipping-your-pages-to-save-bandwidth/</link>
		<comments>http://carbonize.co.uk/wp/2009/02/13/gzipping-your-pages-to-save-bandwidth/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 00:26:11 +0000</pubDate>
		<dc:creator>Carbonize</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.carbonize.co.uk/Blog/archives/54-guid.html</guid>
		<description><![CDATA[<a href="http://carbonize.co.uk/wp/2009/02/13/gzipping-your-pages-to-save-bandwidth/" title="Gzipping your pages to save bandwidth"></a>Ok I&#8217;ve been playing with Javascript frameworks like Jquery and Prototype. Now by default Jquery is 54KB and Prototype is 130KB (at the time of writing this). As you can see these are not small files. Now this is where &#8230;<p class="read-more"><a href="http://carbonize.co.uk/wp/2009/02/13/gzipping-your-pages-to-save-bandwidth/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://carbonize.co.uk/wp/2009/02/13/gzipping-your-pages-to-save-bandwidth/" title="Gzipping your pages to save bandwidth"></a><p>Ok I&#8217;ve been playing with Javascript frameworks like Jquery and Prototype. Now by default Jquery is 54KB and Prototype is 130KB (at the time of writing this). As you can see these are not small files. Now this is where gzip comes in. An easy way to describe gzip is that your server zips up the file before sending it to the web browser and the web browser then unzips it. Anyway by gzipping these two files using some PHP I have got Jquery down to 19KB and prototype down to 30KB!!!!</p>
<p>So we have Jquery:<br />
Original Size: 54 KB<br />
Gzipped Size: 19 KB<br />
Data Savings: 64.81%</p>
<p>and prototype:<br />
Original Size: 131 KB<br />
Gzipped Size: 30 KB<br />
Data Savings: 77.1%</p>
<p><span style="font-size:1">All testing done using <a  class="bb-url" href="http://whatsmyip.org/mod_gzip_test/" target="_blank">mod_zip test</a>.</span></p>
<p>Anyway on to the code.<br />
<span id="more-5"></span><br />
Ok to send something gzipped we need to use PHP&#8217;s <a  class="bb-url" href="http://php.net/ob_start" target="_blank">buffer</a> and so one of the first things we need to do is turn it on. </p>
<pre class="brush: php">&lt;?php
ob_start(&#039;ob_gzhandler&#039;);
?&gt;</pre>
<p>We would then just put our Javascript (or normal HTML) after the ?&gt;</p>
<p>The ob_gzhandler is a function in PHP that checks if a browser supports gzip compression or not and if it doesn&#8217;t then PHP will not gzip the buffer.</p>
<p>Finally we tell PHP that we are done with the buffer and we want it to <a  class="bb-url" href="http://php.net/ob_end_flush" target="_blank">flush</a> the buffer. Flush just means it sends the contents of the buffer to the browser and then closes the buffering.</p>
<pre class="brush: php">&lt;?php
ob_end_flush();
?&gt;</pre>
<p>And that&#8217;s it. So in a nutshell.</p>
<pre class="brush: php">&lt;?php
 ob_start(&#039;ob_gzhandler&#039;);
?&gt;

&lt;!-- Your Javascript or HTML here (or even PHP code) --&gt;

&lt;?php
ob_end_flush();
?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://carbonize.co.uk/wp/2009/02/13/gzipping-your-pages-to-save-bandwidth/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Javascript To Change Image On Link Click</title>
		<link>http://carbonize.co.uk/wp/2008/08/23/javascript-to-change-image-on-link-click/</link>
		<comments>http://carbonize.co.uk/wp/2008/08/23/javascript-to-change-image-on-link-click/#comments</comments>
		<pubDate>Sat, 23 Aug 2008 22:32:26 +0000</pubDate>
		<dc:creator>Carbonize</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.carbonize.co.uk/Blog/archives/49-guid.html</guid>
		<description><![CDATA[<a href="http://carbonize.co.uk/wp/2008/08/23/javascript-to-change-image-on-link-click/" title="Javascript To Change Image On Link Click"></a>I recently decided to add the ability for guests to request a new captcha image (or refresh the captcha image) in my guestbook script for when it was to hard for visitors to read. As usual trying to find some &#8230;<p class="read-more"><a href="http://carbonize.co.uk/wp/2008/08/23/javascript-to-change-image-on-link-click/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://carbonize.co.uk/wp/2008/08/23/javascript-to-change-image-on-link-click/" title="Javascript To Change Image On Link Click"></a><p>I recently decided to add the ability for guests to request a new captcha image (or refresh the captcha image) in my guestbook script for when it was to hard for visitors to read. As usual trying to find some instructions to do this proved useless so I had to figure it out myself. I thought I would explain how it&#8217;s done here for anyone else wanting to do this and believe me it&#8217;s very very simple.</p>
<p>Ok first thing we need to do is give a name to the image we are going to by replacing/changing so we add a name. For the guestbook script I added added <em>name=&#8221;lazCaptcha&#8221;</em> to the image tag.</p>
<p>eg:</p>
<pre class="brush: javascript">&lt;img src=&quot;http://domain.com/path/image.jpg&quot; name=&quot;NAMEFORIMAGE&quot; alt=&quot;&quot; /&gt;</pre>
<p>Next we need to create the link that the viewer clicks on to replace/change the image and for that I used this bit of code:</p>
<pre class="brush: javascript">&lt;a href=&quot;#&quot; onclick=&quot;reloadImage(&#039;NAMEFORIMAGE&#039;); return false;&quot;&gt;request another image&lt;/a&gt;</pre>
<p>Notice how I put the name of the image into the Javascript? Thats so we can use this code multiple times on a single page.</p>
<p>Next we need the Javascript and it is very simple. We just create a random number to add to the image url to prevent it showing the cached image and then tell the browser to change the image. I&#8217;ll show two examples. The first is just when we want to display a random image and the second is how I display a new captcha image with the same code.</p>
<p><span id="more-10"></span>Random Image:</p>
<pre class="brush: javascript">
function reloadImage(imageName)
{
var myImages=new Array();
myImages[0]=&quot;sun.jpg&quot;;
myImages[1]=&quot;moon.jpg&quot;;
myImages[2]=&quot;stars.jpg&quot;;
// Create a random number between 1 and one greater than the number of items in the array
var randomImage = Math.floor(Math.random() * (myImages.length + 1));
randomImage--;
// Change the image
document.images[imageName].src = &#039;http://yoursite.com/path/to/&#039; + myImages[randomImage];
}</pre>
<p>Captcha Image:</p>
<pre class="brush: javascript">function reloadImage(imageName)
{
// Create a random number between 1 and 1000
var randomnumber=Math.floor(Math.random()*1001);
// Change the image
document.images[imageName].src = &#039;http://yoursite.com/path/image.php?hash=OURHASH&amp;rand=&#039; + randomnumber;
}</pre>
<p>OURHASH? What&#8217;s that?  <img src='http://carbonize.co.uk/wp/wp-includes/images/smilies/icon_confused.gif' alt=':-?' class='wp-smiley' />   Well if you are planning to refresh a captcha image then I&#8217;m guessing you have generated the form the image is displayed in and so you can just use the variable you used for the hash in the image tag to put the hash in the javascript image tag. Or you could just change that line to</p>
<pre class="brush: javascript">document.images[imageName].src = document.images[imageName].src + &#039;&amp;rand=&#039; + randomnumber; // Change the image</pre>
<p>And thats it. See how simple it is to do?  <img src='http://carbonize.co.uk/wp/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://carbonize.co.uk/wp/2008/08/23/javascript-to-change-image-on-link-click/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using The PHP mail Function</title>
		<link>http://carbonize.co.uk/wp/2008/01/29/using-the-php-mail-function/</link>
		<comments>http://carbonize.co.uk/wp/2008/01/29/using-the-php-mail-function/#comments</comments>
		<pubDate>Tue, 29 Jan 2008 13:48:42 +0000</pubDate>
		<dc:creator>Carbonize</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.carbonize.co.uk/Blog/archives/35-guid.html</guid>
		<description><![CDATA[<a href="http://carbonize.co.uk/wp/2008/01/29/using-the-php-mail-function/" title="Using The PHP mail Function"></a>Ok been a while since I posted anything so thought I would post my tutorial on using the PHP mail() function. I have basically copied my tutorial word for word from the Lazarus forum. This is a brief (or not) &#8230;<p class="read-more"><a href="http://carbonize.co.uk/wp/2008/01/29/using-the-php-mail-function/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://carbonize.co.uk/wp/2008/01/29/using-the-php-mail-function/" title="Using The PHP mail Function"></a><p>Ok been a while since I posted anything so thought I would post my tutorial on using the <strong>PHP mail()</strong> function. I have basically copied my tutorial word for word from <a  href="http://carbonize.co.uk/Lazarus/Forum/index.php?topic=1444.0">the Lazarus forum</a>.</p>
<p>This is a brief (or not) tutorial on using the <strong>PHP mail()</strong> function to send emails from your scripts.</p>
<p>bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )</p>
<p>Let&#8217;s break that down. The bool means that the <strong>PHP mail</strong> function returns either <strong>true </strong>or <strong>false</strong> depending on if it was successful or not. The rest is pretty self explanatory. string $to is where we put the email address we want to send to. string $subject is where we put the emails subject and string $message is where we put our message. The string part just means that this variable will be treated as a string when used. We will cover $additional_headers a bit later and won&#8217;t even touch on $additional_parameters.</p>
<p>Ok so we want to send an email to <strong>Bill Gates</strong> with the subject <strong>Windows Linux</strong> and our message is <strong>When is it coming out?</strong>. The function we would use looks like this</p>
<div class="bb-code">&lt;?php<br />
mail(&#8216;bill.gates@microsoft.com&#8217;, &#8216;Windows Linux&#8217;, &#8216;When is it coming out?&#8217;);<br />
?&gt;</div>
<p><span id="more-24"></span><br />
This would suit our needs but there are some things you need to know. Firstly this email will be sent as plain text so any HTML tags in the message would be displayed in the message. Second this email would have our servers address as the from address. Before I continue I would like to just briefly touch on the point that you can send to multiple address by putting them in the to section separated by a comma like &#8216;bill.gates@microsoft.com,some@address.com&#8217;. So now let us make it appear to come from our email address <strong>email@address.com</strong>.</p>
<div class="bb-code">&lt;?php<br />
mail(&#8216;bill.gates@microsoft.com&#8217;, &#8216;Windows Linux&#8217;, &#8216;When is it coming out?&#8217;, &#8216;From: email@address.com&#8217;);<br />
?&gt;</div>
<p>As you can see we added a header to our email. The header is From and says what address the email was sent from. We could also use the format From: &quot;Our Name&quot; &lt;email@address.com&gt; so that it also has our name. This is fine and would suit most of your email sending needs but what if you want to send HTML? Then we need some more headers. They are MIME-Version and Content-type. So now our function looks like:</p>
<div class="bb-code">&lt;?php<br />
mail(&#8216;bill.gates@microsoft.com&#8217;, &#8216;Windows Linux&#8217;, &#8216;<b>When</b> is it coming out?&#8217;, &quot;From: email@address.com\nMIME-Version: 1.0\nContent-type: text/html; charset=iso-8859-1&quot;);<br />
?&gt;</div>
<p>You will see I switched from using single quotes to double for the headers. This is because we need to separate the different headers with a new line marker (\n) and this does not work when using single quotes. I won&#8217;t say a lot about what the MIME type means. You can read up on that <a  href="http://en.wikipedia.org/wiki/MIME">HERE</a>. The Content-type says that the email is sent as text but is to be treated as HTML. Part of the Content-type is charset. This tells the email reader what character set to use when displaying the email. You will only have to change this if you are sending your email in a language other than English. Now when our recipient reads the email the word <strong>When</strong> will be bold.</p>
<p>You can also use the headers section to send carbon copies and blind carbon copies of the email to people by using CC: emailaddress and BCC: emailaddress respectively. You still need a main email address to send to though for these to work.</p>
<p>Now some might argue that you should use <strong>\r\n</strong> for separating the headers but in my experience just <strong>\n</strong> on it&#8217;s own is fine and will be understood by all email clients where as <strong>\r\n</strong> may cause problems.</p>
<p>Just a few notes.</p>
<p>If you are ending an email in a language other than English you may need to set the character set even for plain text. This is done the same as above but just replace the text/html with text/plain.</p>
<p>You can use variables for the relevant parts of the email. For example.</p>
<div class="bb-code">&lt;?php<br />
$recipient = &#8216;bill.gates@microsoft.com&#8217;;<br />
$subject = &#8216;Windows Linux&#8217;;<br />
$message = &#8216;When is it coming out?&#8217;;<br />
$headers = &#8216;From: email@address.com&#8217;;</p>
<p>mail($recipient, $subject, $message, $headers);<br />
?&gt;</p></div>
<p>As I also said earlier the mail function returns <strong>TRUE</strong> or <strong>FALSE</strong> depending on if it is successful in sending or not. So we can add some error checking like</p>
<div class="bb-code">&lt;?php<br />
if (@mail(&#8216;bill.gates@microsoft.com&#8217;, &#8216;Windows Linux&#8217;, &#8216;When is it coming out?&#8217;, &#8216;From: email@address.com&#8217;))<br />
{<br />
   echo &#8216;Your mail was successfully sent&#8217;;<br />
}<br />
else<br />
{<br />
   echo &#8216;There was a problem and the email did not get sent&#8217;;<br />
}<br />
?&gt;</div>
<p>You may wonder what the @ is for in front of the mail. The @ before a function tells PHP not to display any error messages that may result from running that function. It just keeps things tidy as we are error checking anyway.</p>
<p>And that&#8217;s about it for the basic usage of the PHP mail() function. Next time I will explain how to send emails that are both HTML and plain text so that our recipient can read it regardless of their email reader. I will also explain about adding attachments to your emails and displaying attached images inside the body of the email.</p>
]]></content:encoded>
			<wfw:commentRss>http://carbonize.co.uk/wp/2008/01/29/using-the-php-mail-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

