<?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>Web Development Blog</title>
	<atom:link href="http://www.web-development-blog.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.web-development-blog.com</link>
	<description>Web development tutorials, SEO articles and PHP script resources</description>
	<lastBuildDate>Wed, 25 Aug 2010 19:46:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>5 Useful jQuery Snippets for your Website</title>
		<link>http://www.web-development-blog.com/archives/5-useful-jquery-snippets-for-your-website/</link>
		<comments>http://www.web-development-blog.com/archives/5-useful-jquery-snippets-for-your-website/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 20:22:29 +0000</pubDate>
		<dc:creator>Olaf</dc:creator>
				<category><![CDATA[PHP scripts]]></category>
		<category><![CDATA[jQuery Code]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[snippets]]></category>

		<guid isPermaLink="false">http://www.web-development-blog.com/?p=1277</guid>
		<description><![CDATA[jQuery is a popular JavaScript library which is used by many developers and applications. While using jQuery you need to write less code, writing functions is less complex and there are a lot of plugins you can use for free in your web application. Even if you code everything by yourself, you need only a [...]]]></description>
			<content:encoded><![CDATA[<p>jQuery is a popular JavaScript library which is used by many developers and applications. While using jQuery you need to write less code, writing functions is less complex and there are a lot of plugins you can use for free in your web application. Even if you code everything by yourself, you need only a few rows of code to create nice and powerful features for your website. If you&#8217;re in hurry check the <a href="http://www.web-development-blog.com/jquery-demo/">jQuery demo page</a>.</p>
<h2>Populate select menus with jQuery and Ajax</h2>
<p>One of the most powerful jQuery function is the <a rel="nofollow" href="http://api.jquery.com/category/ajax/">Ajax Suite</a>. This example shows how-to populate a second select menu based on the option from the first select menu.</p>
<p>Just in case we have this select menu with the main categories:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">label</span> <span style="color: #000066;">for</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;category&quot;</span>&gt;</span>Choose: <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">label</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">select</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;category&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;category&quot;</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;fruit&quot;</span>&gt;</span>Fruit<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;grain&quot;</span>&gt;</span>Grains<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;vegetables&quot;</span>&gt;</span>Vegetables<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">select</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span></pre></div></div>

<p>If someone has changed the value for this select menu, we want to show the equivalent menu inside the span element with the ID &#8220;subcat&#8221;. To do this we use this jQuery snippet that makes an Ajax request to a PHP file called &#8220;getSubCat.php&#8221;. After the select menu is changed a loading image will show up (in case of slow Internet connections), the PHP script is called and the sub-select menu becomes visible.<span id="more-1277"></span></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#category'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">change</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> category <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		$.<span style="color: #660066;">ajax</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
			type<span style="color: #339933;">:</span> <span style="color: #3366CC;">'GET'</span><span style="color: #339933;">,</span>
			url<span style="color: #339933;">:</span> <span style="color: #3366CC;">'getSubCat.php'</span><span style="color: #339933;">,</span>
			data<span style="color: #339933;">:</span> <span style="color: #3366CC;">'cat='</span> <span style="color: #339933;">+</span> category<span style="color: #339933;">,</span>
			dataType<span style="color: #339933;">:</span> <span style="color: #3366CC;">'html'</span><span style="color: #339933;">,</span>
			beforeSend<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#subcat'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;img src=&quot;loader.gif&quot; alt=&quot;loading...&quot; /&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
			success<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#subcat'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The PHP code we are using for the file called getSubCat.php:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Apples'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Pears'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Cherries'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Oranges'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Kiwis'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'grain'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Wheat'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Corn'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'vegetables'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Tomatoes'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Beans'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Peas'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Peperoni'</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// use a database instead, this array is only some simple demo data</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cat'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">array_key_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cat'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'
&lt;select id=&quot;subselect&quot; name=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cat'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cat'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'
&lt;option value=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$key</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$val</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/option&gt;
&nbsp;
'</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'
	&lt;/select&gt;
&nbsp;
'</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Array-key doesn\'t exist'</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Invalid request'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
?<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span></pre></div></div>

<p>This is a simple example on how you can use the Ajax function, the function has much more features which makes it a very flexible function.</p>
<h2>Disable/enable the form submit button with jQuery</h2>
<p>On pages with registration or order forms you like to treat the visitor to accept some terms of service before he/she can continue the form. A very nice function to do this is, to disable the submit button until the visitor has clicked some check box (like: Click here to accept the TOS). The following snippet will enable/disable the submit button after the check box is checked or not.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#accept'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#buybtn'</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">':disabled'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#buybtn'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeAttr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'disabled'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
    	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#buybtn'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'disabled'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'disabled'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Together with this function, we use the following HTML for the submit button:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;accept&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;accept&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;y&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> I accept the conditions!
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;buybtn&quot;</span> <span style="color: #000066;">disabled</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;disabled&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Submit&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Send&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<h2>Simple photo gallery with thumbnails</h2>
<p>If you&#8217;re looking for a light-weight photo gallery function, this snippet is for you. The function works very simple: If the visitor has clicked a thumbnail the value from &#8220;href&#8221; attribute is passed to the &#8220;src&#8221; attribute from the bigger image. Thats all, check the jQuery code and of course the HTML example.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#thumbs a&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> changeSrc <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;href&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#detail&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;src&quot;</span><span style="color: #339933;">,</span> changeSrc<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;detail&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;img/1.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;big view&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;img/1.jpg&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;thumbs/1.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;thumb 1&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;img/2.jpg&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;thumbs/2.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;thumb 2&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;img/3.jpg&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;thumbs/3.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;thumb 3&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></pre></div></div>

<h2>Show and hide HTML elements based on Radio selection</h2>
<p>jQuery has great functions which show or hide HTML elements. This example is about to show some additional list based on a selection which is made by checking a radio button. The script checks first if &#8220;the&#8221; button is checked and shows the additional container, otherwise it hides the &#8220;this&#8221; container.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#payments input[type=radio]'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input[name=payment]:checked'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;creditcard&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#cards&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#cards&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The HTML snippet has a radio group and a DIV container which becomes visible when the radio with the value &#8220;creditcard&#8221; is checked.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;payments&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;creditcard&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;payment&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;radio&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;creditcard&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> Creditcard
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cards&quot;</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">label</span> <span style="color: #000066;">for</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cctype&quot;</span>&gt;</span>Choose one: <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">label</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">select</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cctype&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cctype&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span>&gt;</span>...<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;master&quot;</span>&gt;</span>MasterCard<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;visa&quot;</span>&gt;</span>Visa<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;amex&quot;</span>&gt;</span>American Express<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">select</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;payment&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;radio&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;paypal&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> PayPal<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;payment&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;radio&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;wire&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> Wire/transfer<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></pre></div></div>

<h2>Count clicks for Google Analytics using jQuery</h2>
<p>The last snippet is an easy way to count clicks from external links within a DIV container. Without the requirement to add additional Google Analytics code to your link elements, it&#8217;s possible to count those link clicks in Google Analytics.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#mylinks a[href^=&quot;http&quot;]'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 	pageTracker._trackPageview<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'/outgoing/'</span><span style="color: #339933;">+</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'href'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This tiny function will count the links from a DIV container with the ID &#8220;mylinks&#8221; like:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://simpay.org/&quot;</span>&gt;</span>PayPal Payments<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span> | <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.finalwebsites.com/web_hosting_promotion.php&quot;</span>&gt;</span>Wordpress Hosting<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></pre></div></div>

<p>You can try all these function on this <a href="http://www.web-development-blog.com/jquery-demo/">jQuery demo</a> page, a download link is available on the same page. If you have any question or suggestions, please be my guest and use the comment form below.<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.web-development-blog.com/archives/ajax-requests-using-jquery-and-php/" rel="bookmark" title="December 24, 2009">Ajax requests using jQuery and PHP</a></li>
<li><a href="http://www.web-development-blog.com/archives/your-e-mail-address-hidden-with-jquery/" rel="bookmark" title="February 25, 2010">Your e-mail address hidden with jQuery?</a></li>
<li><a href="http://www.web-development-blog.com/archives/jquery-contact-form-for-your-website/" rel="bookmark" title="January 11, 2010">jQuery Contact form for your website</a></li>
</ul>
<p><!-- Similar Posts took 3.866 ms --></p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.web-development-blog.com/archives/5-useful-jquery-snippets-for-your-website/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Facebook tips for more efficiency and &#8220;fun&#8221;</title>
		<link>http://www.web-development-blog.com/archives/facebook-tips-for-more-efficiency-and-fun/</link>
		<comments>http://www.web-development-blog.com/archives/facebook-tips-for-more-efficiency-and-fun/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 10:54:12 +0000</pubDate>
		<dc:creator>Olaf</dc:creator>
				<category><![CDATA[Google services]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[like]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[share]]></category>
		<category><![CDATA[social media]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://www.web-development-blog.com/?p=1205</guid>
		<description><![CDATA[Since there are more than 500 million users at Facebook, that social network is the place to be meet most your friends. The last years the whole Internet is becoming more social and most new or existing services are providing social features which connect them to social sites like Facebook or Twitter. This article is [...]]]></description>
			<content:encoded><![CDATA[<p>Since there are more than 500 million users at Facebook, that social network is the place to be meet most your friends. The last years the whole Internet is becoming more social and most new or existing services are providing social features which connect them to social sites like Facebook or Twitter. This article is about how-to use Facebook more efficient together with some other services. We don&#8217;t show how-to abuse Facebook. Instead of showing how-to get lots of traffic we are using some tools which let you create more interesting content for your Facebook friends. </p>
<h2>Social features provided by Google</h2>
<p>Right these days there is an active discussion on how the Facebook &#8220;Like&#8221; function is able to manipulate the social rankings in Google. We think social media and Google Search are both important. Sure there are good social media features provided by Google, but they are not widely used. In this article we will explain how Google Reader, Google Sidewiki and YouTube can be used together with Facebook.</p>
<p><a href="http://www.web-development-blog.com/wp-content/uploads/2010/08/facebook_logo.png" rel="shadowbox[post-1205];player=img;"><img src="http://www.web-development-blog.com/wp-content/uploads/2010/08/facebook_logo-150x150.png" alt="" title="facebook_logo" width="150" height="150" class="alignright size-thumbnail wp-image-1224" /></a></p>
<h2>Your (Facebook) friends</h2>
<blockquote><p>Social media is based on having friends, without friends it&#8217;s not possible to interact and without interaction there is no fun. If you don&#8217;t like this, social media is not for you!</p></blockquote>
<p>While Facebook is a network for all your friends (you know), it should be the place where you meet people with similar interests. Invite people (you didn&#8217;t know in person) based on their interests. For example if most of your discussions on Facebook are about Internet marketing, invite people which are interested in similar subjects. Why? If you share marketing related stuff people which are not interested in, they getting bored and will discontinue your friendship. Most of us having friends on other networks as well and many of them should be your friend on Facebook as well. So if your friends are interested in your voice on Facebook, they might be interested what you&#8217;re saying on other networks as well (and visa verca).<span id="more-1205"></span></p>
<h2>Collect interesting content and share it to your friends</h2>
<p>Collecting content for your Facebook profile is easy, you can share interesting blogs from RSS feeds, websites you have discovered and YouTube videos you like. You can share every link from your browser using the Facebook &#8220;Share&#8221; tool (you can install a bookmarklet on your browser&#8217;s toolbar), but even if you&#8217;re logged in on Facebook you need to pass a CAPTCHA verification before your comment is posted.</p>
<h3>Share the best RSS feed items using the Google Reader</h3>
<p>Google Reader is a great tool to manage all your RSS subscriptions and for reading your feeds anywhere. This Google service is widely used by bloggers and you can subscribe to any RSS feed or just follow other Google Reader users if you like what they share. The tool provides a simple share button which will add your <a href="http://www.google.com/reader/shared/olaf.lederer" rel="nofollow">shared items</a> on your own RSS feed/list. In the web version it&#8217;s also a great idea to pass a comment by your shared items. The feature is available in the mobile version too, but there it&#8217;s a buggy function (at least on a windows mobile phone). There is a very good Facebook application called <a href="http://apps.facebook.com/rssgraffiti/" rel="nofollow">RSS Graffiti</a>, using this application, you can publish your <strong>Shared Items</strong> on Facebook just by importing the XML atom feed from Google Reader. The application has a lot of options for the way how you import your feeds (frequency, delay, filter, format, etc.).</p>
<p><img src="http://www.web-development-blog.com/wp-content/uploads/2010/08/rss-graffiti.png" alt="" title="rss-graffiti" width="522" height="334" class="alignnone size-full wp-image-1208" /></p>
<h3>Share your comments on YouTube on Facebook</h3>
<p>YouTube is the Video website on the net, Facebook can host videos too, but there is no search or discover functionality. Make sure you have a YouTube account and create also a <a href="http://www.youtube.com/finalwebsites">YouTube channel</a> where you met friends too. There is a great social feature available in Youtube that makes it possible to share all videos and comments on Facebook as well. Here are the settings (My Account -> Activity Sharing):</p>
<p><img src="http://www.web-development-blog.com/wp-content/uploads/2010/08/YouTube-Activity-Sharing-e1281261657974.png" alt="" title="YouTube - Activity Sharing" width="530" height="206" class="alignnone size-full wp-image-1209" /></p>
<p>On this screen you can choose which (YouTube) activities you like to share with your friends.</p>
<h3>Comment and share websites using Google Sidewiki</h3>
<p>Well the <a href="http://www.google.com/sidewiki/intl/en/index.html" rel="nofollow">Google Sidewiki</a> is not one of the famous service provided by Google, but there are some good points. All Google Sidewiki comments are published to your <a href="http://www.google.com/profiles/olaf.lederer#sidewiki" rel="nofollow">Google profile</a> and this page has also an RSS feed. You can use the RSS feed together with the RSS Graffiti application to share your website comments with your friends.</p>
<p><img src="http://www.web-development-blog.com/wp-content/uploads/2010/08/sidewiki-e1281261740696.png" alt="" title="sidewiki" width="530" height="385" class="alignnone size-full wp-image-1210" /></p>
<p>While using these Google services you&#8217;re able to share links, comments and videos with both friend groups and you will save time as well. I read the most of my RSS feeds on my mobile phone and using Google Reader I&#8217;m able to &#8220;post&#8221; items to my Facebook profile. If needed I can read those article next I&#8217;m behind my notebook and my friends on Facebook can read them too.</p>
<h2>Facebook for your blog or website</h2>
<p>Adding the Facebook &#8220;Share&#8221; button to your website is very easy, but people need to identity first (to block SPAM). With all the discussions about the Facebook &#8220;Like&#8221; function these days, it seems like that Facebook doesn&#8217;t &#8220;like&#8221; the share tool very much. Using the &#8221;Like&#8221; button, a Facebook user is able to share the link and is able to post a comment without leaving the page (check the &#8220;Like&#8221; feature on this page). To get this for 100% working you need to use XFBML version of this feature. We used the following instructions to get it working: </p>
<p>First create a new application on Facebook, access this <a href="http://developers.facebook.com/setup/" rel="nofollow">page</a> and enter the site name and URL. After this step is finished you should get a screen like this one:</p>
<p><img src="http://www.web-development-blog.com/wp-content/uploads/2010/08/facebook-app-e1281261833932.png" alt="" title="facebook-app" width="530" height="532" class="alignnone size-full wp-image-1211" /></p>
<h3>Integrate the Like-Gadget in your <a href="http://www.widgetready.org/buy-wordpress-themes.php">WordPress theme</a></h3>
<p>With the following information you&#8217;re able to prepare your website, we&#8217;re using WordPress for our example. Open your header.php template and replace your HTML opening tag with:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span> xmlns<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span></span>
<span style="color: #009900;">xmlns:og<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://opengraphprotocol.org/schema/&quot;</span></span>
<span style="color: #009900;">xmlns:fb<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.facebook.com/2008/fbml&quot;</span> &lt;?php language_attributes<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span>&gt;</pre></div></div>

<p>Now we need to add some meta information; The Facebook user ID is from your Facebook account. You can find that ID if you click your picture on your Facebook profile page. Copy/paste the application ID from the page where you created the application before. The image URL; You can use one standard image (logo) for all posts or use the thumbnails you&#8217;ve created for your blog posts (if you have done this). This is is how the image value should work, at the moment that this article is written it works random (Facebook is choosing an image from the page).</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> property<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;fb:admins&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;FACEBOOKUSERID&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> property<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;fb:app_id&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;YOUAPPLICATIONID&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;?php if <span style="color: #66cc66;">&#40;</span>is_single<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> ?&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> property<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;og:title&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;?php single_post_title(); ?&gt;</span></span>&quot; /&gt;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> property<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;og:type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;article&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> property<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;og:image&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;IMAGEURL&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> property<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;og:url&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;?php the_permalink(); ?&gt;</span></span>&quot; /&gt;
<span style="color: #009900;">&lt;?php <span style="color: #66cc66;">&#125;</span> ?&gt;</span></pre></div></div>

<p>The snippet above prepares the template to use a &#8220;Like&#8221; button on single post page. Now we need to open the footer.php template file and next add the code before the BODY closing tag:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;fb-root&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
window.fbAsyncInit = function() {
	FB.init({
		appId: &quot;YOUAPPLICATIONID&quot;, status: true, cookie: true,
		xfbml: true
	});
};
(function() {
	var e = document.createElement('script'); e.async = true;
	e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
	document.getElementById('fb-root').appendChild(e);
}());
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></div></div>

<p>Don&#8217;t forget to add your application ID here as well. Now we are ready to add the &#8220;Like&#8221; button to your single.php template file.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;fb_like&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;padding-bottom:5px;&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;fb:like <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'like'</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;400&quot;</span> layout<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;standard&quot;</span> show_faces<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;false&quot;</span> colorscheme<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;light&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<p>I placed that code above the part where the WordPress function the_content() is used.</p>
<h2>Conclusion</h2>
<p>In this article we talked about how-to discover and share content to your friends, but don&#8217;t forget that too much content might be recognized by your friends as SPAM. Find the right balance, if you keep adding friends and you friend-count doesn&#8217;t go up, maybe the frequency for posting external content (links) is too high. The social media user like to interact, give your friends content they can talk about and don&#8217;t forget to talk back!<br />
Adding Facebook gadgets to your website or blog can give your content new exposure and friends (fans). Just use them and if you think that they doesn&#8217;t work for you, it might be possible that your visitors are not on Facebook.<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.web-development-blog.com/archives/social-media-services-are-more-efficient-these-days/" rel="bookmark" title="September 27, 2009">Social media services are more efficient these days</a></li>
<li><a href="http://www.web-development-blog.com/archives/google-wave-invitations-and-youtube-gadget/" rel="bookmark" title="November 15, 2009">Google Wave &#8211; Invitations and YouTube Gadget</a></li>
<li><a href="http://www.web-development-blog.com/archives/internet-marketing-strategies-and-blended-search/" rel="bookmark" title="October 24, 2007">Blended search and the importance of varying your website&#8217;s marketing methods</a></li>
</ul>
<p><!-- Similar Posts took 3.913 ms --></p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.web-development-blog.com/archives/facebook-tips-for-more-efficiency-and-fun/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>PayPal Payment Tools: Information and Resources</title>
		<link>http://www.web-development-blog.com/archives/paypal-payment-tools-information-and-resources/</link>
		<comments>http://www.web-development-blog.com/archives/paypal-payment-tools-information-and-resources/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 14:38:00 +0000</pubDate>
		<dc:creator>Olaf</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[eCommerce]]></category>
		<category><![CDATA[credit card]]></category>
		<category><![CDATA[eBay]]></category>
		<category><![CDATA[merchant]]></category>
		<category><![CDATA[online payments]]></category>
		<category><![CDATA[paypal]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.web-development-blog.com/?p=1189</guid>
		<description><![CDATA[If you&#8217;re looking for a trustful online payment solution, you will always notice PayPal as a well known payment platform. PayPal is a full featured payment solution provider for the (paying) user and for the merchant. This article is about why people should use Paypal and some tools which makes it easier to use this [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re looking for a trustful online payment solution, you will always notice PayPal as a well known payment platform. PayPal is a full featured payment solution provider for the (paying) user and for the merchant. This article is about why people should use Paypal and some tools which makes it easier to use this payment provider.</p>

<h3>Why should you pay using PayPal?</h3>
<p><img src="http://www.web-development-blog.com/wp-content/uploads/2010/07/paypal-verified-e1280065842138.gif" alt="PayPal" title="paypal verified" width="100" height="100" class="alignleft size-full wp-image-1198" style="margin-top:10px;" />Even if you don&#8217;t have a PayPal account, you should process your credit card payment via the PayPal platform. This makes sense if you don&#8217;t know/trust the payment provider from the merchant where you want to buy something. What if this merchant doesn&#8217;t offer the PayPal option on his website? In most cases companies having a Paypal account, just ask the merchant, if he want to make a sale, he will offer this payment method as well.<br />
PayPal is also great if you don&#8217;t like to show a merchant your credit card details. In several countries it&#8217;s possible to pay by PayPal in real-time even if you need to fund your account from your bank account. PayPal is also some kind of online wallet, for example if you sell something on eBay and you get paid via PayPal. Just keep that money in your account and use it for later purchases. If you buy something on eBay and you pay via PayPal, you get some buyer protection. If the seller doesn&#8217;t send you the goods your paid for and he can&#8217;t proof the successful shipment, Paypal will refund your money.<span id="more-1189"></span></p>
<h3>PayPal features for merchants</h3>
<p>As a shop holder you should always offer PayPal payments. Using <a href="https://merchant.paypal.com/cgi-bin/marketingweb?cmd=_render-content&#038;content_ID=merchant/product_services&#038;nav=2.1" rel="nofollow">PayPal as payment option</a> on your e-commerce site enables additional payment methods: MasterCard, VISA and many other cards (depends on the buyer&#8217;s country). Since the funding methods are different for different countries, PayPal payments are the solution to offer many payment options. Some PayPal payment options for your website are:</p>
<ul>
<li><strong>Website Payments Standard</strong> &#8211; Add credit card processing to your site in about 15 minutes.<br />
Use this option if you don&#8217;t like to pay a monthly fee and if your PayPal check-out process must be simple and hosted on the PayPal website. Costs per transaction are low from 2.2% + $0.30.</li>
<li><strong>Website Payments Pro</strong> &#8211; An Internet merchant account and gateway in one.<br />
This service is similar to the products from most other payment providers and the costs are a monthly fee of $30 and the price for each transaction starts from 2.2% + $0.30.</li>
<li><strong>Payflow Payment Gateway</strong> &#8211; Process payments using your own Internet merchant account.<br />
A solution to use PayPal&#8217;s payment gateway (including PayPal payments). Note, the whole payment is processed on the PayPal site.</li>
</ul>
<p>For all these payment options is an <a href="https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&#038;content_ID=developer/e_howto_api_ButtonMgrAPIIntro" rel="nofollow">API system</a> available.</p>
<h3>Selected PayPal tools and services</h3>
<p>Most of the PayPal features require some setup or you need to add some code (or button) on your website. What if you just need to send a payment request to someone (without knowing his PayPal address or you need just a link that someone can pay you with his credit card? For Microsoft Outlook users is on the PayPal website a <a href="https://www.paypal.com/us/cgi-bin/webscr?cmd=p/sell/payment_wizard_intro-outside" rel="nofollow">plugin available</a> which acts like a kind of wizard that creates the button code you can place into your email. </p>
<blockquote><p>This wizard is a nice solution, but this button might be a problem if the html code gives the e-mail message a higher SPAM ranking.</p></blockquote>
<p><strong>SIMPAY</strong> offers functions where the <a href="http://simpay.org/">PayPal payment request</a> is created on-site in a pre-defined form and where the user can send a unique link via e-mail or an instant message system. It&#8217;s also possible to e-mail a payment request for <a href="http://simpay.org/subscription-payments.php">recurring payments</a>. </p>
<p>Another great service is <a href="http://fundrazr.com/"rel="nofollow">FundRazr</a>, they created, together with PayPal, a Facebook application which enables the user to setup a gadget that shows the &#8220;charity&#8221; and all related information. Other Facebook members will see the gadget on the wall from the fund raiser and are able to send him money via PayPal or they share the gadget on their own wall.</p>
<p><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.web-development-blog.com/archives/setting-up-an-internet-shopping-cart/" rel="bookmark" title="November 11, 2007">Setting up an Internet shopping cart</a></li>
<li><a href="http://www.web-development-blog.com/archives/easy-payments-using-paypal-ipn/" rel="bookmark" title="March 14, 2008">Easy payments using Paypal IPN</a></li>
<li><a href="http://www.web-development-blog.com/archives/top-your-sales-with-google-commerce-search/" rel="bookmark" title="November 29, 2009">Top your sales with Google Commerce Search</a></li>
</ul>
<p><!-- Similar Posts took 3.603 ms --></p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.web-development-blog.com/archives/paypal-payment-tools-information-and-resources/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Start a hosting business with DirectAdmin</title>
		<link>http://www.web-development-blog.com/archives/start-a-hosting-business-with-directadmin/</link>
		<comments>http://www.web-development-blog.com/archives/start-a-hosting-business-with-directadmin/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 07:32:53 +0000</pubDate>
		<dc:creator>Olaf</dc:creator>
				<category><![CDATA[PHP scripts]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[dedicated server]]></category>
		<category><![CDATA[directadmin]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[socket]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://www.web-development-blog.com/?p=1172</guid>
		<description><![CDATA[There are thousands of hosting companies on the Internet and maybe this article will help you to start your own. Many companies offering web services are hosting reseller of other (bigger) companies or have partnerships with hosting companies. Maybe you have ever thought to offer hosting services by yourself, with a dedicated server or a [...]]]></description>
			<content:encoded><![CDATA[<p>There are thousands of hosting companies on the Internet and maybe this article will help you to start your own. Many companies offering web services are hosting reseller of other (bigger) companies or have partnerships with hosting companies. Maybe you have ever thought to offer hosting services by yourself, with a dedicated server or a VPS hosting account, it&#8217;s very easy to offer hosting plans for your existing customers. The following article will show you, using a few examples, how to use a web server installed with the software DirectAdmin to create web hosting accounts using their native API system.</p>
<blockquote><p>Don&#8217;t think it&#8217;s easy to pull a new hosting company from the ground. This market is very saturated and we suggest to start offering hosting services most of all to your existing customers only.</p></blockquote>
<h3>VPS hosting versus dedicated server hosting</h3>
<p>These days it&#8217;s not necessary to have your own dedicated server, a good maintained VPS host is often much more reliable. If the VPS hosting platform is well managed, you don&#8217;t have to worry about the shared memory because the virtualization software is able to manage all the resources. Why do you need a dedicated server if a VPS is so powerful? You need your own server for special hardware configurations or if your provider doesn&#8217;t have a good VPS platform. While many VPS companies using the same machines, the risk of hardware failures is low because hardware replacements should be a peace of cake. A &#8220;special&#8221; dedicated or colocated server might be a serious risk, f.e if the motherboard replacement is not available. <strong>A VPS host is scalable and often much cheaper than a dedicated server.<br />
</strong><span id="more-1172"></span></p>
<h3>Web Server Control Panel</h3>
<p>Using a control panel, makes it easy to create or maintain all the web hosting accounts for your customers. Sure as a Linux expert you don&#8217;t need a CP, but if you core business is web development, a control panel might really help. There are many of them, most of them are commercial products, but there are also a a few open source projects which are available for free. In this blog post we suggest to use <a href="http://www.directadmin.com/" rel="nofollow">DirectAdmin</a>, because this software is easy to use, the license is not very expensive and there is also a very powerful API system.</p>
<h3>Installing DirectAdmin</h3>
<p>After you got your VPS (or dedicated server) you&#8217;re ready to install the server software. Before you start the installation process check these DirectAdmin requirements. Most important is that your Linux server is not pre-installed with software like Apache, MySQL, PHP, FTP&#8230; check this warning from the DA website:</p>
<blockquote><p>***Please do not install services such as Apache, PHP, MySQL, Ftp, Sendmail, etc., as we will do this for you.  All we need is a CLEAN install of your operating system.***<br />
We do not recommend installing DirectAdmin on an existing live production server.<br />
DirectAdmin does not convert existing data upon install. </p></blockquote>
<p>For most DirectAdmin hosts CentOS is the preferred Linux operating system. You need also a DirectAdmin license, ask your VPS hosting provider, he can offer the license for a low fee. </p>
<p><strong>DirectAdmin installation resources:</strong></p>
<ul>
<li><a href="http://www.directadmin.com/install.html" rel="nofollow">Getting Started with DirectAdmin: What kind of server do I need?</a></li>
<li><a href="http://www.directadmin.com/installguide.html" rel="nofollow">DirectAdmin Installation Guide</a></li>
</ul>
<p>The installation process is not part of this article. If you finished the installation part, you should check this <a href="http://www.web-development-blog.com/archives/how-to-setup-the-dns-and-name-server-for-a-directadmin-web-server/">DNS installation guide</a>. </p>
<h3>Creating hosting accounts</h3>
<p>After the final re-boot and your DirectAdmin server is running, you&#8217;re able to setup hosting accounts for your customers. You can create them by yourself using the DA control panel or using the DirectAdmin API within your web application. Think about the following application process:</p>
<ol>
<li>Customer has ordered a hosting accpunt from your website</li>
<li>The payment is cleared and a request is send the API system</li>
<li>Within DirectAdmin a hosting account is created</li>
<li>The customer gets the login and hosting accpunt details via e-mail</li>
</ol>
<p>How far you&#8217;re using this features of DA depends on yourself. The <a href="http://www.directadmin.com/api.html" rel="nofollow">DirectAdmin API</a> is able to manage all functions you need. This way you&#8217;re able to create your own we application, without telling your customers that a control panel is used.</p>
<h3>Access the DirectAdmin API system</h3>
<p>The API documentation is very complete and easy to use even for less experienced developers. There is also a custom PHP class to access the API via a HTTP socket, <a href="http://files.directadmin.com/services/all/httpsocket/httpsocket.php" rel="nofollow">download the code here</a>.</p>
<p>Using this PHP class is very easy, the following code is used to fetch all the user accounts from a reseller/admin account:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">include_once</span> <span style="color: #0000ff;">'httpsocket.php'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sock</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HTTPSocket<span style="color: #339933;">;</span>
<span style="color: #000088;">$sock</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">connect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'some.server.com'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2222</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #000088;">$sock</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_login</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'login'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sock</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/CMD_API_SHOW_USERS'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">parse_str</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sock</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetch_body</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// shows the result in the browser</span></pre></div></div>

<p>Next we show how-to add a new user to an existing reseller account (the package named &#8220;default&#8221; is a pre-defined hosting package):</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">include_once</span> <span style="color: #0000ff;">'httpsocket.php'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sock</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HTTPSocket<span style="color: #339933;">;</span>
<span style="color: #000088;">$sock</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">connect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'some.server.com'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2222</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sock</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_login</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'login'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sock</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/CMD_API_ACCOUNT_USER'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'action'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'create'</span><span style="color: #339933;">,</span> 
	<span style="color: #0000ff;">'add'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Submit'</span><span style="color: #339933;">,</span> 
	<span style="color: #0000ff;">'username'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'abcuser'</span><span style="color: #339933;">,</span> 
	<span style="color: #0000ff;">'email'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'mail@domain.com'</span><span style="color: #339933;">,</span> 
	<span style="color: #0000ff;">'passwd'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'123456'</span><span style="color: #339933;">,</span> 
	<span style="color: #0000ff;">'passwd2'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'123456'</span><span style="color: #339933;">,</span> 
	<span style="color: #0000ff;">'domain'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'googles.com'</span><span style="color: #339933;">,</span> 
	<span style="color: #0000ff;">'package'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'default'</span><span style="color: #339933;">,</span> 
	<span style="color: #0000ff;">'ip'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'123.123.123.123'</span><span style="color: #339933;">,</span> 
	<span style="color: #0000ff;">'notify'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'yes'</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">parse_str</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sock</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetch_body</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// shows the result in the browser</span></pre></div></div>

<p>This API call is the same as creating a user from the web interface:</p>
<p><a href="http://www.web-development-blog.com/wp-content/uploads/2010/07/create_user.png" rel="shadowbox[post-1172];player=img;"><img src="http://www.web-development-blog.com/wp-content/uploads/2010/07/create_user-300x146.png" alt="" title="create_user" width="300" height="146" class="alignnone size-medium wp-image-1180" /></a></p>
<p>If you check all the API functions, you will see that it&#8217;s possible to create a 100% white labeled web application. Even if you don&#8217;t have that kind of web application, it&#8217;s very easy to create hosting accounts using the web interface on your DirectAdmin web server.</p>
<p><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.web-development-blog.com/archives/how-to-setup-the-dns-and-name-server-for-a-directadmin-web-server/" rel="bookmark" title="September 17, 2007">How-to setup the DNS and name server for a DirectAdmin web server</a></li>
<li><a href="http://www.web-development-blog.com/archives/create-custom-website-backups-using-cron/" rel="bookmark" title="October 17, 2009">Create custom website backups using CRON</a></li>
<li><a href="http://www.web-development-blog.com/archives/setting-up-an-internet-shopping-cart/" rel="bookmark" title="November 11, 2007">Setting up an Internet shopping cart</a></li>
</ul>
<p><!-- Similar Posts took 4.166 ms --></p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.web-development-blog.com/archives/start-a-hosting-business-with-directadmin/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>E-mail marketing software, which is the best for you?</title>
		<link>http://www.web-development-blog.com/archives/e-mail-marketing-software-which-is-the-best-for-you/</link>
		<comments>http://www.web-development-blog.com/archives/e-mail-marketing-software-which-is-the-best-for-you/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 05:21:16 +0000</pubDate>
		<dc:creator>Olaf</dc:creator>
				<category><![CDATA[Internet Marketing]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[affiliate]]></category>
		<category><![CDATA[campaign]]></category>
		<category><![CDATA[e-mail marketing]]></category>
		<category><![CDATA[mailchimp]]></category>
		<category><![CDATA[mailing list]]></category>

		<guid isPermaLink="false">http://www.web-development-blog.com/?p=1155</guid>
		<description><![CDATA[If you search Google for E-mail marketing software you will find a lot of services and I&#8217;m sure a lot of them have great features and are worth the money. The pricing for 1000 mail messages is often very similar and most of them offer a back-end which makes it easy to setup a mailing [...]]]></description>
			<content:encoded><![CDATA[<p>If you search Google for E-mail marketing software you will find a lot of services and I&#8217;m sure a lot of them have great features and are worth the money. The pricing for 1000 mail messages is often very similar and most of them offer a back-end which makes it easy to setup a mailing list and marketing campaigns. </p>
<blockquote><p>If all of them have similar features, how do choose the right one? </p></blockquote>
<h3>Some important features</h3>
<ul>
<li>Creating a mailing list takes a lot of time and might be essential for your e-mail marketing success. While collecting subscribers and sending e-mail messages, it&#8217;s important that as many messages as possible have to reach the subscribers mailbox. Bigger companies are more trusted and invest more time an money to prevent that their mail servers are getting black-listed.</li>
<li>If your list is not very big (~1000 subscriber) and you don&#8217;t have a lot of campaigns, your partner should offer pre-paid plans. If you take a monthly plan, check that the maximum amount of subscribers is not to big. </li>
<li>If you&#8217;re not able to create all the forms and templates, you need a service provider which offer these features out of the box. If you have an international list or campaigns, multiple languages should be supported.</li>
<li>A better service provider let you follow strict usage policies. If you need to create campaigns for your existing list, check if the list is fully accepted (before you start customizing forms and templates). On the other side, if the service provider accept any kind of mailing list and or campaign, it might be possible that their mail servers are black-listed frequently.</li>
<li>All services should offer double opt-in features for your subscriptions. Check if you are able to send an auto-respond message to your subscribers.</li>
</ul>
<p><span id="more-1155"></span><br />
In the past year I was able to try three of the bigger services; <strong>iContact</strong>, <strong>MailChimp</strong> and <strong>CampaignMonitor</strong>. <a href="http://www.aweber.com/" rel="nofollow">AWeber</a> looks pretty good and earns a lot of trust and I&#8217;m sure you will not waste your time if you try them as well. They don&#8217;t offer a free trial, but at the moment while I&#8217;m writing this review they offer the first month for only $1 ($19 for the following months). </p>
<h3>iContact &#8211; E-mail marketing simplified</h3>
<p><a href="http://www.dpbolvw.net/click-2408474-10640618?sid=review" target="_top" rel="nofollow"><br />
<img src="http://www.tqlkg.com/image-2408474-10640618" width="125" height="125" alt="Contact.com - Email Marketing Service " border="0" class="alignleft" /></a>I tried <a href="http://www.dpbolvw.net/click-2408474-10528631?sid=review" rel="nofollow">iContact</a> first a year ago and actually it works as they offer the service on their website. You can open a trial account to setup your mailing list and templates/forms. If you want to import a bigger list you need to pay first. They offer only monthly plans, &#8220;pay as you go&#8221; options are not possible. They have all the features like other professional companies, but it looks to me they didn&#8217;t update their control panel for the last 3 years (the WYSIWYG editor is very ugly). Every mail message I send, got the iContact branding in the footer, which you can&#8217;t remove. I have the idea that they don&#8217;t have a strong usage policy because I got NEVER complains for high percentage of un-subscriptions, high bounce rates or complains. They offer a survey function (I never tried) and they support several 3rd party plugins (WordPress, Joomla, Drupal, SalesForce&#8230;)</p>
<h3>MailChimp &#8211; Email Marketing and Email List Manager</h3>
<p><a href="http://www.mailchimp.com/" rel="nofollow">MailChimp</a> is the best service for a beginning mailing list, because they offer a free plan for lists with less than 500 subscribers. They offering great and easy to use tools for creating lists and campaigns. With a lot of 3rd party plugins (Facebook, SalesForce, Magento, Paypal and many <a href="http://www.mailchimp.com/features/extras" rel="nofollow">more</a>) they are one of the biggest email marketing partners. Using MailChimp you can go for monthly pricing or &#8220;pay as you go&#8221;. The last option is for people sending less frequently a newsletter to their members. Another features are: Custom responder messages, complete forms for your website, powerful API system (offering complete example code), Google Analytics integration, advanced reports and much <a href="http://www.mailchimp.com/features/full_list" rel="nofollow">more</a>. They have a very strict policy on abusing their system, will say don&#8217;t use them for a mailing list you have bought somewhere on the Internet. Very unique is their affiliate scheme, if someone has joined MailChimp via your affiliate link and the user has upgraded to a paid account, both parties getting a $30 bonus (new user and the affiliate). You can&#8217;t turn this bonus into cash, but maybe is an opportunity to run your (bigger) mailing list for free.</p>
<h3>CampaignMonitor &#8211; Email marketing software for web designers</h3>
<p>The first thing you will notice after free trial sign-up is that you login into some kind of reseller area. With <a href="http://www.campaignmonitor.com/" rel="nofollow">CampaignMonitor</a> it&#8217;s possible to create mailing lists completely white-label (even for the user of the back-end). Against MailChimp the back-end has less features, but you&#8217;re able to create your campaigns with custom templates or using the premium templates offered by CampaignMonitor. They offer monthly and &#8220;pay as you go&#8221; plans and their usage policy is somewhere between the one from iContact and the policy from MailChimp. While their back-end is very modern and functional, they don&#8217;t offer enough features for lists in languages other than English. If you need to setup your list in a different language, you should try the API which is powerful as well.</p>
<p>If you start a new mailing list, most of the products or services should work for you, but if you need a provider for your existing list you need to test them first.<br />
<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.web-development-blog.com/archives/running-a-mailing-list-for-increased-traffic-and-sales/" rel="bookmark" title="September 3, 2007">Running a mailing list for increased traffic and sales</a></li>
<li><a href="http://www.web-development-blog.com/archives/integrate-your-mailchimp-newsletter-subscription/" rel="bookmark" title="October 26, 2009">Integrate your MailChimp Newsletter Subscription</a></li>
<li><a href="http://www.web-development-blog.com/archives/how-to-choose-a-wordpress-hosting-provider/" rel="bookmark" title="January 24, 2010">How-to choose a WordPress Hosting Provider</a></li>
</ul>
<p><!-- Similar Posts took 3.752 ms --></p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.web-development-blog.com/archives/e-mail-marketing-software-which-is-the-best-for-you/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>404 Errors: Report, monetize and analyse</title>
		<link>http://www.web-development-blog.com/archives/404-errors-report-monetize-and-analyse/</link>
		<comments>http://www.web-development-blog.com/archives/404-errors-report-monetize-and-analyse/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 04:57:00 +0000</pubDate>
		<dc:creator>Olaf</dc:creator>
				<category><![CDATA[Google services]]></category>
		<category><![CDATA[PHP scripts]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[404 error]]></category>
		<category><![CDATA[adsense]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[site search]]></category>

		<guid isPermaLink="false">http://www.web-development-blog.com/?p=1136</guid>
		<description><![CDATA[After your websites getting more pages and links, the chance that a visitor will follow a dead link to your site exists. If a visitor is trying to access a page on your site, the server will report (normally) a 404 error. The response is by default some unfriendly page with some spare information about [...]]]></description>
			<content:encoded><![CDATA[<p>After your websites getting more pages and links, the chance that a visitor will follow a dead link to your site exists. If a visitor is trying to access a page on your site, the server will report (normally) a 404 error. The response is by default some unfriendly page with some spare information about the error which let most visitors stop visiting your site. But using the 404 error the right way, you the site owner can collect important information like:</p>
<ul>
<li>Of course the broken link or URL</li>
<li>The HTTP_REFERER information where the dead link is available</li>
<li>How often people try to access the bad URL</li>
</ul>
<p>Using the right tools you&#8217;re able to turn 404 errors into a powerful resource:</p>
<ul>
<li>Provide a site search feature and let people search what they are looking</li>
<li>Add advertisements to your error page and start earning money</li>
<li>Learn about what people like to see on your site</li>
</ul>
<p>In this tutorial we will show you how-to:</p>
<ul>
<li>Create a dynamic error page using the Google Site search and Adsense content ads</li>
<li>Setup Google analytics to track 404 errors using a filter</li>
<li>Set the site search feature with Google Analytics to collect the search queries from your visitor</li>
</ul>
<p><span id="more-1136"></span></p>
<h3>Error reporting page</h3>
<p>With the Apache webserver it&#8217;s possible to use custom directives for your error script, place this code into your .htaccess file (place the file into the site root):<br />
<code><br />
ErrorDocument 400 /error.php?err=400<br />
ErrorDocument 401 /error.php?err=401<br />
ErrorDocument 403 /error.php?err=403<br />
ErrorDocument 404 /error.php?err=404<br />
ErrorDocument 500 /error.php?err=500<br />
</code><br />
We use for the custom error script the most common HTTP errors.<br />
Next we need to create a PHP script called error.php which can handle the different errors:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$errorNum</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$err_str</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">404</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Not Found'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">400</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Bad Request'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">401</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Unauthorized'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">403</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Forbidden'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">500</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Internal Server Error'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$err_str</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$errorNum</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;An error occured: '</span><span style="color: #339933;">.</span><span style="color: #000088;">$err_str</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$errorNum</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/h1&gt;
&nbsp;
&lt;!-- place here your advertisement --&gt;
&nbsp;
&lt;!-- place here your Google analytics code --&gt;
&lt;/body&gt;
&lt;/html&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>This script will show the different errors and also some advertisement if you add the ad code. Don&#8217;t forget to add the GA code snippet.</p>
<h3>Track dead links in Google Analytics</h3>
<p>In case of a 404 error the page title on this custom error page will be &#8220;Not Found&#8221;. We use the page title as a filter in Google Analytics to track the page views. Create a new profile for the site you&#8217;re working on and add this filter:</p>
<p><a href="http://www.web-development-blog.com/wp-content/uploads/2010/06/Edit-Filter-Google-Analytics1.png" rel="shadowbox[post-1136];player=img;"><img src="http://www.web-development-blog.com/wp-content/uploads/2010/06/Edit-Filter-Google-Analytics1-300x178.png" alt="" title="Edit-Filter-Google-Analytics" width="300" height="178" class="alignnone size-medium wp-image-1144" /></a></p>
<h3>Adding Google Site Search to your 404 error page</h3>
<p>If you haven&#8217;t done yet, create a <a href="http://www.google.com/cse/manage/create">Google site search</a> for your website. Add only your own website to the list of searched sites and don&#8217;t search the entire web. Add your Google Adsense ID (section &#8220;Make Money&#8221;) and head to the section &#8220;Look and feel&#8221; and select the option Iframe. Choose a style for the search form / result and maybe you like to customize the style. Push now the button &#8220;Get code&#8221; (or enter the section &#8220;Get code&#8221; from the sidebar) and enter there the URL from your error page.<br />
Copy / paste the code for the search form and the results into the body section from your error page. Your completed page will look like:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$errorNum</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$err_str</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">404</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Not Found'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">400</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Bad Request'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">401</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Unauthorized'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">403</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Forbidden'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">500</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Internal Server Error'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$err_str</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$errorNum</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;An error occured: '</span><span style="color: #339933;">.</span><span style="color: #000088;">$err_str</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$errorNum</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/h1&gt;
&nbsp;
&lt;form action=&quot;http://www.yourdomain.com/error.php&quot; id=&quot;cse-search-box&quot;&gt;
  &lt;div&gt;
    &lt;input type=&quot;hidden&quot; name=&quot;cx&quot; value=&quot;thisCodeIsProvidedByGoogleCSE&quot; /&gt;
    &lt;input type=&quot;hidden&quot; name=&quot;cof&quot; value=&quot;FORID:10&quot; /&gt;
    &lt;input type=&quot;hidden&quot; name=&quot;ie&quot; value=&quot;UTF-8&quot; /&gt;
    &lt;input type=&quot;text&quot; name=&quot;q&quot; size=&quot;31&quot; /&gt;
    &lt;input type=&quot;submit&quot; name=&quot;sa&quot; value=&quot;Zoeken&quot; /&gt;
  &lt;/div&gt;
&lt;/form&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en&quot;&gt;&lt;/script&gt;
&nbsp;
&lt;div id=&quot;cse-search-results&quot;&gt;&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  var googleSearchIframeName = &quot;cse-search-results&quot;;
  var googleSearchFormName = &quot;cse-search-box&quot;;
  var googleSearchFrameWidth = 600;
  var googleSearchDomain = &quot;www.google.com&quot;;
  var googleSearchPath = &quot;/cse&quot;;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://www.google.com/afsonline/show_afs_search.js&quot;&gt;&lt;/script&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'q'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// show the ad only if there is no search</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'
&lt;!-- place here your advertisement --&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> 
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'
&lt;!-- place here your Google analytics code --&gt;
&lt;/body&gt;
&lt;/html&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>We placed the add code also into some <strong>IF</strong> clause, because there should not be another Google Adsense advertisement beside the Google ads from the result page.</p>
<h3>Enable site search tracking in Google Analytics</h3>
<p>The code for the error page is complete and we move to the last step: Tracking the site search queries from the error page. To do this we need to go in Google Analytics to the profile we created for the error page and click <strong>Edit</strong> (twice), check the setting <strong>Do Track Site Search</strong>, enter a &#8220;q&#8221; as the &#8220;Query Parameter&#8221; and click <strong>Safe Changes</strong>.</p>
<p>This error page is very basic and you need add your sites <a href="http://www.all4yourwebsite.com/website_templates.php">web template</a> to make it complete. If you like this tutorial and you have used the code on your own site please share the URL to your new or updated error page. Even if you don&#8217;t like to use the code from this page, we advice to track the errors and also the site search queries from your visitors. If you have questions or comments please post them below.<br />
<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.web-development-blog.com/archives/top-your-sales-with-google-commerce-search/" rel="bookmark" title="November 29, 2009">Top your sales with Google Commerce Search</a></li>
<li><a href="http://www.web-development-blog.com/archives/new-search-options-but-unrelated-results-in-google-blog-search/" rel="bookmark" title="October 1, 2009">New Search Options but unrelated results in Google Blog Search</a></li>
<li><a href="http://www.web-development-blog.com/archives/create-custom-backups-from-your-website-using-curl/" rel="bookmark" title="July 30, 2008">Create custom backups from your website using cURL</a></li>
</ul>
<p><!-- Similar Posts took 3.766 ms --></p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.web-development-blog.com/archives/404-errors-report-monetize-and-analyse/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Online Backup Service &#8211; Comparison</title>
		<link>http://www.web-development-blog.com/archives/online-backup-service-comparison/</link>
		<comments>http://www.web-development-blog.com/archives/online-backup-service-comparison/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 06:26:01 +0000</pubDate>
		<dc:creator>finalwebsites.com</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[hard-disk]]></category>
		<category><![CDATA[online backup]]></category>
		<category><![CDATA[services]]></category>
		<category><![CDATA[sharing]]></category>
		<category><![CDATA[Synchronization]]></category>

		<guid isPermaLink="false">http://www.web-development-blog.com/?p=1123</guid>
		<description><![CDATA[For those people spending a lot of time behind a laptop or desktop PC, some safe backup storage becomes very important. Until a few few weeks ago, I created every night an incremental backup for my files and stored this data on a USB connected hard-disk. While the HD was shock-proof (FreeCom), my motherboard was [...]]]></description>
			<content:encoded><![CDATA[<p>For those people spending a lot of time behind a laptop or desktop PC, some safe backup storage becomes very important. Until a few few weeks ago, I created every night an incremental backup for my files and stored this data on a USB connected hard-disk. While the HD was shock-proof (FreeCom), my motherboard was much weaker. It seems that the motherboard died during the daily backup was processed. Why? Because my hard-disk wasn&#8217;t accessible the next day. My backup seems to be worthless and I was very happy that a replacement of the motherboard was the rescue for my data.</p>
<blockquote><p>Everyone will understand my next step: I started my search for a better backup solution!</p></blockquote>
<h3>Are online backup services the best solution?</h3>
<p>Since my laptop has the Ubuntu operating system, I gave <strong>Ubuntu One</strong> a try. They offer 2GB of free backup space and since Ubuntu version 9.10 you need only to register an online account. That sounds easy right? Just put your backup data into the <strong>Ubuntu One directory</strong> and wait until the demon has uploaded all files. They offer great features too; synchronization between multiple PCs, sharing files with trusted contacts and there is  a web browser interface. They offer also a paid plan; 50GB storage for $10/month. Not so much actually, but maybe to much for a beta service. In my case Ubuntu One wasn&#8217;t the best solution for me. Uploading files took a lot of time and the demon/client needs a restart frequently.</p>

<blockquote><p>Important: You need to trust your backup service provider!<span id="more-1123"></span></p></blockquote>
<h3>There are more professional online backup services</h3>
<p>There are many companies offering these services and they offering different packages for different needs. Since the synchronization features are very nice (think about how easy you can restore your data to a new computer) I searched  for services offering this features. A second requirement were multi-platform capabilities. The last one is very important because you never know where you need to work with your data. Maybe you need to switch from Linux to Windows or Mac. We tried the following 3 services, all of them offer 2GB of free backup space. So if you like, you can try them all for free.</p>
<h3>Mozy &#8211; Home Edition</h3>
<p><a rel="nofollow" href="http://www.kqzyfj.com/click-2408474-10446057" target="_blank"> <img class="alignleft" style="border: 0pt none; margin-right: 5px; margin-top: 15px;" src="http://www.awltovhc.com/image-2408474-10446057" border="0" alt="Unlimited Backup only $4.95" width="120" height="60" /></a>They offer unlimited space for a low monthly price: $4.95 (discounts for yearly payments are also available). Sounds great? It is, for Windows and Mac user. They backup after the first full backup only changed/new files and it&#8217;s easy to restore your data if you need that. A <a rel="nofollow" href="http://www.kqzyfj.com/click-2408474-10446057" target="_blank">Mozy backup</a> is a great &#8220;mirror&#8221; for your data, but doesn&#8217;t offer synchronization features for multiple computers. Mozy is a great solution if you have a lot of data (for example photos) and you need &#8220;only&#8221; a secure backup solution.</p>
<h3>Dropbox</h3>
<p>I&#8217;m sure most of you already know <a rel="nofollow" href="http://www.dropbox.com/">Dropbox</a>, they offer all you need: online back, synchronization and file sharing. First 2GB of space are free and 50GB of backup space are only $9.99 a month. Check these features:</p>
<ul>
<li><strong>File Sync</strong>
<ul>
<li>Sync files of any size or type.</li>
<li>Sync Windows, Mac and Linux computers.</li>
<li>Automatically syncs when new files or changes are detected.</li>
<li>Efficient sync &#8211; only the pieces of a file that changed (not the whole file) are synced.</li>
</ul>
</li>
<li><strong>File Sharing</strong>
<ul>
<li>Shared folders allow several people to collaborate on a set of files.</li>
<li>A &#8220;Public&#8221; folder that lets you link directly to files in your Dropbox.</li>
<li>Control who is able to access shared folders.</li>
<li>Automatically create shareable online photo galleries from folders of photos in your Dropbox.</li>
</ul>
</li>
<li><strong>Online Backup</strong>
<ul>
<li>Automatic backup of your files.</li>
<li>Undelete files and folders.</li>
<li>Restore previous versions of your files.</li>
<li>30 days of undo history, with unlimited undo available as a paid option.</li>
</ul>
</li>
</ul>
<p>Dropbox is a great backup service for Windows, Linux and Mac users with a lot of features. They have also a great referral system, if you refer friends you get free backup space for your (free) account. Special is also that you&#8217;re able to share single files with other people, even if they are not a Dropbox user.</p>
<h3>SpiderOak</h3>
<p>The features for <a rel="nofollow" href="https://spideroak.com/">SpiderOak</a> are almost the same compared to Dropbox, but their paid plan is much cheaper, only $10 / month for 100GB of backup space (discounts for yearly payments are also available). The service looks more safe, Encrypted (FAST) data transport and fully encrypted data storage. The company looks more professional to me, but this is only my personal opinion as an open source fanatic. They don&#8217;t offer single file sharing, but they offer file sharing functions for directories. There is <strong>one killer feature</strong> which Dropbox doesn&#8217;t have: Using Spideroak you&#8217;re able to backup/sync every directory from you hard-disk, while Dropbox has only one directory which is used for the backups.</p>
<p><br />
<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.web-development-blog.com/archives/sync-outlook-and-google-apps-on-your-mobile-phone/" rel="bookmark" title="May 13, 2010">Sync Outlook and Google Apps on your mobile phone</a></li>
<li><a href="http://www.web-development-blog.com/archives/tutorial-create-a-zip-file-from-folders-on-the-fly/" rel="bookmark" title="September 24, 2007">Tutorial: Create a zip file from folders on the fly</a></li>
<li><a href="http://www.web-development-blog.com/archives/create-custom-website-backups-using-cron/" rel="bookmark" title="October 17, 2009">Create custom website backups using CRON</a></li>
</ul>
<p><!-- Similar Posts took 3.741 ms --></p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.web-development-blog.com/archives/online-backup-service-comparison/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Create PDF documents Online with TCPDF</title>
		<link>http://www.web-development-blog.com/archives/create-pdf-documents-online-with-tcpdf/</link>
		<comments>http://www.web-development-blog.com/archives/create-pdf-documents-online-with-tcpdf/#comments</comments>
		<pubDate>Thu, 27 May 2010 17:50:26 +0000</pubDate>
		<dc:creator>Olaf</dc:creator>
				<category><![CDATA[PHP scripts]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[documents]]></category>
		<category><![CDATA[invoice]]></category>
		<category><![CDATA[methods]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[php class]]></category>
		<category><![CDATA[tcpdf]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.web-development-blog.com/?p=1098</guid>
		<description><![CDATA[Many web applications using PDF documents for invoices, contracts and many other doc types. There are a few PHP classes which are able to create PDF documents online, one of them is TCPDF. This tutorial is about how-to use the TCPDF class while creating a simple invoice document. If you like to take a sneak [...]]]></description>
			<content:encoded><![CDATA[<p>Many web applications using PDF documents for invoices, contracts and many other doc types. There are a few PHP classes which are able to create PDF documents online, one of them is TCPDF. This tutorial is about how-to use the TCPDF class while creating a simple invoice document. If you like to take a sneak peak on the result, check this website which generates the <a href="http://www.pdffacturatie.nl/">PDF Invoice</a> document on the fly.</p>
<h3>Why TCPDF and not some other PHP class?</h3>
<p><a href="http://www.tcpdf.org/" rel="nofollow">TCPDF</a> is based on the <a href="http://fpdf.org/" rel="nofollow">FPDF</a> class, a very stable project written for PHP4. Since several years has TCPDF much more features than FPDF and is written for PHP5 (there is also a PHP4 version). The TCPDF has also some great <a href="http://www.tecnick.com/pagefiles/tcpdf/doc/com-tecnick-tcpdf/TCPDF.html" rel="nofollow">documentation</a> and of course examples for all important PDF jobs like:<br />
WriteHTML and RTL support, Multiple columns, JavaScript and Forms, Bookmarks (Table of Content), Multicell complex alignment, Barcodes, Set PDF viewer display preferences, EPS/AI vectorial images and many <a href="http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf_examples" rel="nofollow">more</a>.</p>
<h3>The Zend Framework has some PDF class too&#8230;</h3>
<p>Yes right, the first plan was to write this tutorial about the Zend Framework, but after writing a few rows of code I&#8217;ve noticed that the <a href="http://framework.zend.com/manual/en/zend.pdf.html" rel="nofollow">PDF Class</a> is missing some important functions, like the <strong>MultiCell</strong>, which is used to wrap multiple rows of text. It&#8217;s a <strong>required</strong> function which was suggested as the <a href="http://framework.zend.com/wiki/display/ZFPROP/Zend_Pdf_Cell+-+Logan+Buesching" rel="nofollow">Zend_Pdf_Cell</a> 2 years ago and didn&#8217;t find the way to the core version until now. I like the Zend Framework a lot but<span id="more-1098"></span> not for creating PDF documents, the PDF class is much too limited. <img src='http://www.web-development-blog.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<h3>Okay let&#8217;s start the tutorial:</h3>
<p>In this tutorial we create a PDF invoice including header logo, the invoice rows, an information box and some footer row.<br />
In our code we include some PHP files, next we&#8217;ve created a small class extension to have a custom header/footer and some handy method which creates a text box.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tcpdf/config/lang/eng.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tcpdf/tcpdf.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> MYPDF <span style="color: #000000; font-weight: bold;">extends</span> TCPDF <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">Header</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setJPEGQuality</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">90</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Image</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'logo.png'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">120</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">75</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'PNG'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'http://www.finalwebsites.com'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Footer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SetY</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">15</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SetFont</span><span style="color: #009900;">&#40;</span>PDF_FONT_NAME_MAIN<span style="color: #339933;">,</span> <span style="color: #0000ff;">'I'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Cell</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'finalwebsites.com - PHP Script Resource, PHP classes and code for web developer'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'C'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> CreateTextBox<span style="color: #009900;">&#40;</span><span style="color: #000088;">$textval</span><span style="color: #339933;">,</span> <span style="color: #000088;">$x</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$y</span><span style="color: #339933;">,</span> <span style="color: #000088;">$width</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$height</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fontsize</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fontstyle</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$align</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'L'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SetXY</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #000088;">$y</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// 20 = margin left</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SetFont</span><span style="color: #009900;">&#40;</span>PDF_FONT_NAME_MAIN<span style="color: #339933;">,</span> <span style="color: #000088;">$fontstyle</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fontsize</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Cell</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$width</span><span style="color: #339933;">,</span> <span style="color: #000088;">$height</span><span style="color: #339933;">,</span> <span style="color: #000088;">$textval</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #000088;">$align</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The <strong>header</strong> method has only two functions, one sets the image quality and the second will place an image (including hyperlink) on a defined place (x=120, Y=10, width=75). All coordinates are measured in Millimeters and the height for the image is calculated by the script. Inside the footer method we&#8217;re using some basic TCPDF methods to define the position, the font/style and the cell with the footer text. The third method (CreateTextBox) is just a group of TCPDF functions which makes it easier to place some text box into the PDF document. Note, the constant variable <strong>PDF_FONT_NAME_MAIN</strong> is defined inside the TCPDF config file, which is located inside the <strong>config</strong> directory.</p>
<h3>The invoice header</h3>
<p>The following code will create a TCPDF object with default values, the PDF meta data gets defined (author, title, etc.), a page is added and the invoice header with information is created using our custom text box method.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// create a PDF object</span>
<span style="color: #000088;">$pdf</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MYPDF<span style="color: #009900;">&#40;</span>PDF_PAGE_ORIENTATION<span style="color: #339933;">,</span> PDF_UNIT<span style="color: #339933;">,</span> PDF_PAGE_FORMAT<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'UTF-8'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// set document (meta) information</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SetCreator</span><span style="color: #009900;">&#40;</span>PDF_CREATOR<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SetAuthor</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Olaf Lederer'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SetTitle</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'TCPDF Example'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SetSubject</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'TCPDF Tutorial'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SetKeywords</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'TCPDF, PDF, example, tutorial'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// add a page</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">AddPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// create address box</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CreateTextBox</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Customer name Inc.'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">55</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">80</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'B'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CreateTextBox</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Mr. Tom Cat'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">60</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">80</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CreateTextBox</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Street address'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">65</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">80</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CreateTextBox</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Zip, city name'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">70</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">80</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// invoice title / number</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CreateTextBox</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Invoice #201012345'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">90</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">120</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">16</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// date, order ref</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CreateTextBox</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Date: '</span><span style="color: #339933;">.</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Y-m-d'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'R'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CreateTextBox</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Order ref.: #6765765'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">105</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'R'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Invoice Rows</h3>
<p>Now we create the information about the products we like put into the PDF invoice. First we create some headers and than we use a <strong>foreach</strong> loop to output our <strong>$orders</strong> array.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// list headers</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CreateTextBox</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Quantity'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">120</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'B'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'C'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CreateTextBox</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Product or service'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">120</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">90</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'B'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CreateTextBox</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Price'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">110</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">120</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">30</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'B'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'R'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CreateTextBox</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Amount'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">140</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">120</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">30</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'B'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'R'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Line</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">129</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">195</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">129</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// some example data</span>
<span style="color: #000088;">$orders</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'quant'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'descr'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'.com domain registration'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'price'</span> <span style="color: #339933;">=&gt;</span> <span style="color:#800080;">9.95</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$orders</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'quant'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'descr'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'.net domain name renewal'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'price'</span> <span style="color: #339933;">=&gt;</span> <span style="color:#800080;">11.95</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$orders</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'quant'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'descr'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'SSL certificate 256-Byte encryption'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'price'</span> <span style="color: #339933;">=&gt;</span> <span style="color:#800080;">99.95</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$orders</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'quant'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'descr'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'25GB VPS Hosting, 200GB Bandwidth'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'price'</span> <span style="color: #339933;">=&gt;</span> <span style="color:#800080;">19.95</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$currY</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">128</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$total</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$orders</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CreateTextBox</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'quant'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$currY</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'C'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CreateTextBox</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'descr'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #000088;">$currY</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">90</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CreateTextBox</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'$'</span><span style="color: #339933;">.</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'price'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">110</span><span style="color: #339933;">,</span> <span style="color: #000088;">$currY</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">30</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'R'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$amount</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'quant'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">*</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'price'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CreateTextBox</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'$'</span><span style="color: #339933;">.</span><span style="color: #000088;">$amount</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">140</span><span style="color: #339933;">,</span> <span style="color: #000088;">$currY</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">30</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'R'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$currY</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$currY</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$total</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$total</span><span style="color: #339933;">+</span><span style="color: #000088;">$amount</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Line</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #000088;">$currY</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">195</span><span style="color: #339933;">,</span> <span style="color: #000088;">$currY</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>After the headers and after the list of invoice items we create a line. Inside the loop, we use the variable <strong>$currY</strong> to raise the <strong>Y coordinate by 5</strong> for each new row. The row amount is calculated by PHP and also the total amount is raised inside the <strong>foreach</strong> loop.</p>
<h3>Invoice footer and information</h2>
<p>First we create a total row using the value from the variable <strong>$total</strong> we created before. After that row we have a <strong>MultiCell</strong> which can hold the payment conditions or just some other information. You can use HTML code in this cell as well, for example a link to your terms and conditions.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// output the total row</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CreateTextBox</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Total'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #000088;">$currY</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">135</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'B'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'R'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CreateTextBox</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'$'</span><span style="color: #339933;">.</span><span style="color: #990000;">number_format</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$total</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'.'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">140</span><span style="color: #339933;">,</span> <span style="color: #000088;">$currY</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">30</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'B'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'R'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// some payment instructions or information</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setXY</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #000088;">$currY</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">30</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SetFont</span><span style="color: #009900;">&#40;</span>PDF_FONT_NAME_MAIN<span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">MultiCell</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">175</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;em&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit&lt;/em&gt;. &lt;br /&gt;
Vestibulum sagittis venenatis urna, in pellentesque ipsum pulvinar eu. In nec &lt;a href=&quot;http://www.google.com/&quot;&gt;nulla libero&lt;/a&gt;, eu sagittis diam. Aenean egestas pharetra urna, et tristique metus egestas nec. Aliquam erat volutpat. Fusce pretium dapibus tellus.'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'L'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Close and output PDF document</span>
<span style="color: #000088;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Output</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'test.pdf'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'F'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>At the end we call the output method which will safe the created PDF under the name test.pdf and sends the document to the browser.</p>
<p>This is just an example to show how easy it is to create PDF files online. Before you start your own PDF scripts, check all the <a href="http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf_examples" rel="nofollow">TCPDF examples</a> to get an idea how-to use the different methods.</p>
<p><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.web-development-blog.com/archives/search-for-photos-using-php-and-the-flickr-api/" rel="bookmark" title="December 19, 2009">Search for photos using PHP and the flickr API</a></li>
<li><a href="http://www.web-development-blog.com/archives/how-to-create-a-password-generator-using-php/" rel="bookmark" title="November 22, 2009">How-to create a Password Generator using PHP</a></li>
<li><a href="http://www.web-development-blog.com/archives/jquery-form-plugin-and-php-file-uploads/" rel="bookmark" title="November 2, 2009">jQuery form plugin and PHP file uploads</a></li>
</ul>
<p><!-- Similar Posts took 4.162 ms --></p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.web-development-blog.com/archives/create-pdf-documents-online-with-tcpdf/feed/</wfw:commentRss>
		<slash:comments>46</slash:comments>
		</item>
		<item>
		<title>Sync Outlook and Google Apps on your mobile phone</title>
		<link>http://www.web-development-blog.com/archives/sync-outlook-and-google-apps-on-your-mobile-phone/</link>
		<comments>http://www.web-development-blog.com/archives/sync-outlook-and-google-apps-on-your-mobile-phone/#comments</comments>
		<pubDate>Thu, 13 May 2010 12:29:24 +0000</pubDate>
		<dc:creator>Olaf</dc:creator>
				<category><![CDATA[Google services]]></category>
		<category><![CDATA[activesync]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[google apps]]></category>
		<category><![CDATA[outlook]]></category>
		<category><![CDATA[synchronize]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.web-development-blog.com/?p=1084</guid>
		<description><![CDATA[I&#8217;m using Google Apps as my primary e-mail service for almost 4 years now and I must say the product has grown a lot within the last 2 years. A year ago I got my first cell phone powered by windows mobile and a few days ago I decided to synchronize my e-mail plus calendar [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using Google Apps as my primary e-mail service for almost 4 years now and I must say the product has grown a lot within the last 2 years. A year ago I got my first cell phone powered by windows mobile and a few days ago I decided to synchronize my e-mail plus calendar with the data I have entered on my phone. Just one more feature offered by Google Apps.</p>
<p>Honestly I tried this before but without success, why? Because I missed one big point, this service is only available for <strong>premium accounts</strong>. In my case, I like to synchronize much more. As I mentioned before, I have a &#8220;personal&#8221; Google Apps account and a Windows mobile phone, but I&#8217;m using also a Microsoft Exchange account at the office, which I like to synchronize with my Windows mobile phone. The synchronization tool on the phone allows only one server and in fact I have two. But there is a possibility to arrange this.</p>
<h3>Synchronize Microsoft Outlook with Google Apps</h3>
<p>There is a <a href="https://tools.google.com/dlpage/gappssync" rel="nofollow">Google Apps Sync tool</a> to synchronize both accounts (Outlook and Google Apps) with each other including contacts, e-mail, tasks and the calendar. I tried that tool, but I don&#8217;t like to have a second Outlook profile for my personal stuff. 1-2 year ago there was already the <a href="http://www.google.com/support/calendar/bin/answer.py?answer=89955" rel="nofollow">Google Calendar Sync tool</a> which is able to synchronize the Outlook calendar with the calendar from a Google Apps account. I needed to search the Google Calendar Documentation to find this tool back because Google doesn&#8217;t mention this tool anymore (the suggest the new sync tool instead). It works for Outlook 2003/2007 and with the latest version I&#8217;m able to synchronize my calendars in one or two ways:<span id="more-1084"></span></p>
<p><a href="http://www.web-development-blog.com/wp-content/uploads/2010/05/calendar-sync-tool.jpg" rel="shadowbox[post-1084];player=img;"><img src="http://www.web-development-blog.com/wp-content/uploads/2010/05/calendar-sync-tool-285x300.jpg" alt="" title="google calendar sync tool" width="285" height="300" class="alignnone size-medium wp-image-1088" /></a></p>
<p>In my case I want to show events from my Outlook calendar in my Google calendar; this is the one way synchronization (the 3rd option). I&#8217;m very surprised about the quality of this tool. I tested the following calendar updates, I made in Microsoft Outlook and all of them are updated to my Google calendar as well:</p>
<ul>
<li>Changing details from an existing item in the future</li>
<li>Moving the item to another day</li>
<li>Removing the item from the calendar</li>
<li>Updating some items from the past</li>
</ul>
<p>After the synchronization between Outlook and Google Apps is working we can start the synchronization between Google Apps and my Windows phone.</p>
<h3>Synchronize Google Apps with Windows Mobile</h3>
<p>Be sure you have a Google Apps <strong>Premium account</strong> and ActiveSync is available on your Windows mobile phone. Otherwise the synchronization will not work. Follow the instructions on how-to setup the Google Apps account for ActiveSync using these <a href="http://www.google.com/support/mobile/bin/answer.py?answer=138636&#038;topic=14299" rel="nofollow">instructions</a>. The screen-shots on that page might be different from them on your phone, but they should explain how-to setup the different options. I suggest to un-check the <strong>Contacts</strong>; in my case I use 20-30 contacts on my phone and have hundreds in my contact list on Google (you don&#8217;t wanna sync them all). After anything is done start the synchronization, but don&#8217;t forget that the synchronization process is done via the mobile Internet. If you don&#8217;t have a mobile Internet account it might be very expensive for you.</p>
<p><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.web-development-blog.com/archives/online-backup-service-comparison/" rel="bookmark" title="June 5, 2010">Online Backup Service &#8211; Comparison</a></li>
<li><a href="http://www.web-development-blog.com/archives/facebook-tips-for-more-efficiency-and-fun/" rel="bookmark" title="August 9, 2010">Facebook tips for more efficiency and &#8220;fun&#8221;</a></li>
<li><a href="http://www.web-development-blog.com/archives/create-surveys-with-google-forms/" rel="bookmark" title="April 6, 2010">Create surveys with Google Forms</a></li>
</ul>
<p><!-- Similar Posts took 3.606 ms --></p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.web-development-blog.com/archives/sync-outlook-and-google-apps-on-your-mobile-phone/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Mail Scripts using SMTP transport, a guide for beginners</title>
		<link>http://www.web-development-blog.com/archives/php-mail-scripts-using-smtp-transport-a-guide-for-beginners/</link>
		<comments>http://www.web-development-blog.com/archives/php-mail-scripts-using-smtp-transport-a-guide-for-beginners/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 09:53:26 +0000</pubDate>
		<dc:creator>Olaf</dc:creator>
				<category><![CDATA[PHP scripts]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[php classes]]></category>
		<category><![CDATA[phpmailer]]></category>
		<category><![CDATA[smtp]]></category>
		<category><![CDATA[swift mailer]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://www.web-development-blog.com/?p=1049</guid>
		<description><![CDATA[PHP has a very simple mail function which is used very often for basic text mail messages. What if you need to attach files or if you need to send your e-mail messages via SMTP? Than it&#8217;s time to use a more advanced script. This is because the standard mail function has only limited standard [...]]]></description>
			<content:encoded><![CDATA[<p>PHP has a very <a href="http://www.finalwebsites.com/forums/topic/php-mail-script">simple mail function</a> which is used very often for basic text mail messages. What if you need to attach files or if you need to send your e-mail messages via SMTP? Than it&#8217;s time to use a more advanced script. This is because the standard mail function has only limited standard capabilities. There are many reasons to use SMTP transport for sending e-mail messages from your web application, some of them are:</p>
<ul>
<li>Many <a href="http://www.webfaction.com/?affiliate=finalwebsites" rel="nofollow">shared hosting providers</a> doesn&#8217;t allow to use the PHP mail() function for security reasons</li>
<li>Your web application is more flexible if you use the Simple Message Transfer Protocol (SMTP). This way your e-mail function is not limited to the servers port or e-mail configuration anymore. </li>
<li>SMTP is much more powerful and secure (using SSL)</li>
</ul>
<p>In this article we will compare three of the bigger PHP projects which allow to send e-mail messages via SMTP, including attachments. <span id="more-1049"></span></p>
<ol>
<li>The Mail class included in the <strong>Zend Framework</strong> (http://framework.zend.com/)</li>
<li><strong>Swift Mailer</strong> (http://swiftmailer.org/)</li>
<li><strong>PHPMailer</strong> (http://phpmailer.worxware.com)</li>
</ol>
<p>We reviewed these three PHP classes because they&#8217;re written for PHP5 and they are updated frequently. For our review we tried the provided examples and the documentation. We&#8217;re sure that all three classes are very powerful and offer many functions for almost every type of web application. Because this review should help the beginning PHP developer, this article is sho-case for a few functions only.</p>
<h3>Our test case for this review</h3>
<p>For our example we tested all three classes to send a plain text mail message with a single image attachment, using SMTP transport with authentication. Here is the good news; as a more experienced PHP user, I was able to use the provided examples within several minutes for each of the classes.</p>
<h3>Zend Mail Class</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">ini_set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'include_path'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'.:/path2directory/ZendFramework/library/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">require_once</span> <span style="color: #0000ff;">'Zend/Loader.php'</span><span style="color: #339933;">;</span>
Zend_Loader<span style="color: #339933;">::</span><span style="color: #004000;">loadClass</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Zend_Mail'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Zend_Loader<span style="color: #339933;">::</span><span style="color: #004000;">loadClass</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Zend_Mail_Transport_Smtp'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$config</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'auth'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'login'</span><span style="color: #339933;">,</span> 
              <span style="color: #0000ff;">'username'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'smtpUser'</span><span style="color: #339933;">,</span>
              <span style="color: #0000ff;">'password'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'smtpPassword'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$transport</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Mail_Transport_Smtp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'smtp.server.com'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$config</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Mail<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$at</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">createAttachment</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'path/logo.png'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$at</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">filename</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'logo.png'</span><span style="color: #339933;">;</span>                                  
<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setBodyText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'This is the text inside the mail send by Zend_Mail using SMTP transport.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setFrom</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'you@mail.com'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Your Name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addTo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'contact@mailservice.us'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Your friend'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setSubject</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Mail Subject'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">send</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$transport</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>I don&#8217;t like the documentation from the Zend framework, you need to check many pages to get all the required code for the snippet above. You need to create a second object to send your message via SMTP. I&#8217;m missing the information on their site about how-to test the &#8220;send&#8221; function to create use a success or error message. Using the class is not very difficult, but installing the Zend Framework might be a hard job for the beginner. This class is a great solution for people already using the Zend Framework or where the the library is provided by the hosting provider.</p>
<h3>Swift Mailer</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">require_once</span> <span style="color: #0000ff;">'Swift/lib/swift_required.php'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$transport</span> <span style="color: #339933;">=</span> Swift_SmtpTransport<span style="color: #339933;">::</span><span style="color: #004000;">newInstance</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'smtp.server.com'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">25</span><span style="color: #009900;">&#41;</span>
  <span style="color: #339933;">-&gt;</span><span style="color: #004000;">setUsername</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'smtpUser'</span><span style="color: #009900;">&#41;</span>
  <span style="color: #339933;">-&gt;</span><span style="color: #004000;">setPassword</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'smtpPassword'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$mailer</span> <span style="color: #339933;">=</span> Swift_Mailer<span style="color: #339933;">::</span><span style="color: #004000;">newInstance</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$transport</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> Swift_Message<span style="color: #339933;">::</span><span style="color: #004000;">newInstance</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Wonderful Subject'</span><span style="color: #009900;">&#41;</span>
  <span style="color: #339933;">-&gt;</span><span style="color: #004000;">setFrom</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'you@mail.com'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Your Name'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #339933;">-&gt;</span><span style="color: #004000;">setTo</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'contact@mailservice.us'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Your friend'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #339933;">-&gt;</span><span style="color: #004000;">setBody</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'This is the text of the mail send by Swift using SMTP transport.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$attachment</span> <span style="color: #339933;">=</span> Swift_Attachment<span style="color: #339933;">::</span><span style="color: #004000;">newInstance</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'path/logo.png'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'logo.png'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
<span style="color: #000088;">$message</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">attach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$attachment</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$numSent</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$mailer</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">send</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Sent <span style="color: #009933; font-weight: bold;">%d</span> messages<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$numSent</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The snippet looks similar to the code from the Zend mail class, but you have to create 4 different objects:</p>
<ol>
<li>An object for the SMTP transport (Swift_SmtpTransport)</li>
<li>The object that will send the message (Swift_Mailer)</li>
<li>The message object for all mail parts (Swift_Message)</li>
<li>An object for the attachment (Swift_Attachment)</li>
</ol>
<p>The configuration/installation is much easier than for the Zend Framework, just include one single file and you&#8217;re ready to use the class. If you like this OOP (Object Oriented Programming) style used in this class, this script might be for you.</p>
<h3>PHPMailer</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">require_once</span> <span style="color: #0000ff;">'PHPMailer5/class.phpmailer.php'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$mail</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PHPMailer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">IsSMTP</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Host</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'smtp.server.com'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Port</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">25</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SMTPAuth</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Username</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'smtpUser'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Password</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'smtpPassword'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SetFrom</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'you@mail.com'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Your Name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">AddAddress</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'contact@mailservice.us'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Your friend'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'PHPMailer Message'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Body</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'This e-mail is sent through PHPMailer.'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">AddAttachment</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'path/logo.png'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'logo.png'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Send</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Mailer error: '</span><span style="color: #339933;">.</span><span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ErrorInfo</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Message has been sent.'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The coding style from this example looks very different from the two others and some PHP developer would say this is not really OOP code. Right PHPMailer doesn&#8217;t have one file for each method and for the example above you need to upload only two files. I like the PHPMailer class because of all the information you get on the project&#8217;s website. </p>
<p>The three examples above should help you to make the decision which script will work the best for you. Check the links below for the documentation related to the snippets I have used in this artikel:</p>
<ul>
<li><a href="http://framework.zend.com/manual/en/zend.mail.html" rel="nofollow">http://framework.zend.com/manual/en/zend.mail.html</a></li>
<li><a href="http://swiftmailer.org/docs/introduction" rel="nofollow">http://swiftmailer.org/docs/introduction</a></li>
<li><a href="http://phpmailer.worxware.com/index.php?pg=examplebsmtp" rel="nofollow">http://phpmailer.worxware.com/index.php?pg=examplebsmtp</a></li>
</ul>
<p><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.web-development-blog.com/archives/send-e-mail-messages-via-smtp-with-phpmailer-and-gmail/" rel="bookmark" title="September 1, 2009">Sending e-mails via SMTP with PHPmailer and Gmail</a></li>
<li><a href="http://www.web-development-blog.com/archives/jquery-contact-form-for-your-website/" rel="bookmark" title="January 11, 2010">jQuery Contact form for your website</a></li>
<li><a href="http://www.web-development-blog.com/archives/integrate-your-mailchimp-newsletter-subscription/" rel="bookmark" title="October 26, 2009">Integrate your MailChimp Newsletter Subscription</a></li>
</ul>
<p><!-- Similar Posts took 4.114 ms --></p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.web-development-blog.com/archives/php-mail-scripts-using-smtp-transport-a-guide-for-beginners/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->