<?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/"
	>

<channel>
	<title>Searchlight Digital</title>
	<atom:link href="http://searchlightdigital.com/feed" rel="self" type="application/rss+xml" />
	<link>http://searchlightdigital.com</link>
	<description></description>
	<pubDate>Tue, 06 Jan 2009 15:43:01 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Affiliate Marketing 101: How to Do It</title>
		<link>http://searchlightdigital.com/affiliate-marketing-101-how-to-do-it</link>
		<comments>http://searchlightdigital.com/affiliate-marketing-101-how-to-do-it#comments</comments>
		<pubDate>Tue, 06 Jan 2009 15:29:54 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
		
		<category><![CDATA[affiliate marketing]]></category>

		<category><![CDATA[content creation]]></category>

		<guid isPermaLink="false">http://searchlightdigital.com/?p=402</guid>
		<description><![CDATA[A little while ago, I wrote a post about affiliate marketing, and what it is. This follows on from that one, and we&#8217;ll be looking here about how you can get started as an affiliate, what markets to look at, and how you can make some money from it. I&#8217;ll also do another post in [...]]]></description>
			<content:encoded><![CDATA[<p>A little while ago, I wrote a post about affiliate marketing, and what it is. This follows on from that one, and we&#8217;ll be looking here about how you can get started as an affiliate, what markets to look at, and how you can make some money from it. I&#8217;ll also do another post in a couple of days looking at how you can take this further.</p>
<h3>All About Passion</h3>
<p>I think the basic stumbling block most people face when they get started in affiliate marketing is they want to make money. Sounds odd, but stick with me on this one. Most of the really successful affiliate marketers I know didn&#8217;t get into the game thinking &#8220;I&#8217;m going to make a shedload of money off affiliate marketing.&#8221; Instead, they created a site about a topic they knew about and were passionate about, and at some point later in the game, they looked into ways to monetise it, and wound up using affiliate marketing as a method of doing that.</p>
<p>The key thing to note here is that they weren&#8217;t setting out to build and affiliate site. Many of them then went on to do that later, but they applied what they knew from already having one successful site first. And there&#8217;s the difference.</p>
<p>Their starting point is generally &#8220;What do I have a passion for, that I can write about?&#8221;, not &#8220;What has a really good CPL payout?&#8221; or &#8220;What is hot in search numbers at the moment?&#8221;. When you get into this, do it for the right reasons: you want to create a really awesome site, that will be monetisable. Anything else is the wrong reason (because aside from anything else, you might discover that affiliate marketing isn&#8217;t the best monetisation method long term for whatever the niche is).</p>
<h3>Creating Some Content</h3>
<p>Once you&#8217;ve picked your niche, you&#8217;ll have to create a website. I&#8217;ll go into that some other time (we&#8217;ll be doing a series of posts on building a site and site design and all that malarkey in the future), because it&#8217;s too big a topic to cover here. Instead, what we&#8217;ll look at now is content creation.</p>
<p>The first thing that you&#8217;re going to need to do is start building content on your site, to start generating some traffic. What I&#8217;d suggest for this is that you find all the big blogs in the niche you&#8217;re going into, and see what posts have the most comments, see what they&#8217;re writing on, what topics come up over and over again. This is going to give you some idea as to what the community is interested in. From here, you can start creating your own content.</p>
<p>To start doing that, I&#8217;d suggest you pick ten separate topics in your niche, and write a post on each one. This will do two things:</p>
<ol>
<li>Show you whether you actually have an interest in whatever the subject is, because if you get bored of talking about it, it&#8217;s probably not the right niche for you, and</li>
<li>Give you a solid base to build your site off</li>
</ol>
<p>Now, you could get around this by going down the outsourcing route, but really I&#8217;d suggest that if you&#8217;re not that interested in whatever your site is, then that&#8217;ll come across, and other people won&#8217;t be interested in it either.</p>
<h3>One Inch Wide and Ten Miles Deep</h3>
<p>The final thing I&#8217;ll say in this post is, with everything you write, make sure you&#8217;re writing about the right things. As a general rule, the tighter you focus on your market, the better you&#8217;ll do. Now, I don&#8217;t mean with this that you should only stick to one topic, but instead only write on topics that your audience will be interested in.</p>
<p>As an example, our blog has a readership composed of mainly web and tech related readers. They&#8217;re interested in marketing, programming, web design, and other such digital things. So we cover those topics. We don&#8217;t focus on one idea obsessively, we focus on one <em>market</em> obsessively. You need to do the same. Talk about the things your audience are interested in. So if your site is on Star Trek, you could probably talk about other sci-fi shows too, because you&#8217;re talking about a sub-niche of a broader niche (Star Trek in the sci-fi niche). You&#8217;d probably do well to write about Battlestar Galactica, Red Dwarf, Star Wars and other such things. Similarly, if you write about computer components, you could probably branch out to talk about gadgets and technology in more general terms. Again, the audience is interested in those things too.</p>
<p>The key with creating a site people want to visit is creating content people want to see. As long as you focus on your audience obsessively, you can&#8217;t go far wrong.</p>
<h3>Onwards and Upwards</h3>
<p>In the next post in this series, we&#8217;ll look at how to pick products to promote, and how to promote them without pissing people off. Until then, if you&#8217;ve got any questions, leave a comment below and we&#8217;ll try and help out!</p>
]]></content:encoded>
			<wfw:commentRss>http://searchlightdigital.com/affiliate-marketing-101-how-to-do-it/feed</wfw:commentRss>
		</item>
		<item>
		<title>PHP For Dummies Part 3: It&#8217;s All About Your Form</title>
		<link>http://searchlightdigital.com/php-for-dummies-its-all-about-your-form</link>
		<comments>http://searchlightdigital.com/php-for-dummies-its-all-about-your-form#comments</comments>
		<pubDate>Tue, 06 Jan 2009 14:45:39 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
		
		<category><![CDATA[industry]]></category>

		<category><![CDATA[link building]]></category>

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

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

		<guid isPermaLink="false">http://searchlightdigital.com/?p=404</guid>
		<description><![CDATA[In the last part we looked at the maths functions in PHP, and by extension, most of the operators. What we&#8217;re looking at today is form building. This is where we start to put the sexy in PHP. Using forms we can send data to databases, process inputs, check things, and generally just do stuff.
With [...]]]></description>
			<content:encoded><![CDATA[<p>In the last part we looked at the maths functions in PHP, and by extension, most of the operators. What we&#8217;re looking at today is form building. This is where we start to put the sexy in PHP. Using forms we can send data to databases, process inputs, check things, and generally just <em>do</em> stuff.</p>
<p>With that in mind, let&#8217;s take a look at basic form building&#8230;</p>
<h3>Straight Spine, Shoulders Back</h3>
<p>In this first example, we&#8217;re going to build a form that will take some text that a user has entered and output it on the next page. This is about as simple as you can get, but it forms the basis of 99% of the forms you&#8217;ll build using PHP. Others may use more complex scripts, or do more processing on the data, but the principle is the same: enter data, do something with it, output something.</p>
<p>Now let&#8217;s build some code. The first part is going to be the html for the form, which we&#8217;ll call form.html (original, I know).</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;html&gt;
&lt;head&gt;
	&lt;title&gt;&lt;/title&gt;
	&lt;meta name=&quot;description&quot; content=&quot;&quot;/&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;style.css&quot; /&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;div id=&quot;wrapper&quot;&gt;
		&lt;form action=&quot;send.php&quot; method=&quot;post&quot;&gt;
			&lt;label for=&quot;input&quot; class=&quot;label&quot;&gt;Enter your message:&lt;/label&gt;
			&lt;input type=&quot;text&quot; name=&quot;message&quot; size=&quot;30&quot;&gt;
			&lt;input type=&quot;submit&quot; value=&quot;Send&quot; class=&quot;button&quot;&gt; 
		&lt;/form&gt;
	&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>And the CSS file we&#8217;re creating, style.css, should look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="css css" style="font-family:monospace;"><span style="color: #cc00cc;">#wrapper</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">300px</span>; <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> 0 <span style="color: #993333;">auto</span>; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50px</span> 0 0; <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.label</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span>; <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span>; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">150px</span>; <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.button</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0.9em</span>; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">4px</span>; <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#333</span>; <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#eee</span>; <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#999</span>; <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span>; <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>So what we&#8217;ve done so far is:</p>
<ul>
<li>Create a basic form in HTML</li>
<li>Tell it to use the script send.php to process it, and</li>
<li>Style it with CSS</li>
</ul>
<p>What we need to do now is create the send.php file, so it&#8217;ll actually do something. So let&#8217;s do that!</p>
<h3>Processing, Processing</h3>
<p>The following is the script send.php, which we told the form to use in form.html.</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// Get the data from the form...</span>
<span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="">'message'</span><span style="color: #009900;">&#93;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">// ...and output it</span>
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;Confucius, he say: <span style="color: #000099; font-weight: bold;">\&quot;</span>&lt;i&gt;$data&lt;/i&gt;<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span>;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>What this does is say create a variable called data, and then give it the value of whatever is in the field called &#8216;message&#8217;. It then takes this variable and says print the following message: <em>&#8216;Confucius, he say &#8216;</em> followed by whatever is in the data variable. So if we submitted  the message <em>&#8216;Your Mum!&#8217;</em>, then the output would be <em>&#8216;Confucius, he say: Your Mum!&#8217;</em>.</p>
<p>PHP actually supports both Get and Post methods of submission. To use Get instead, you&#8217;d change the method (in form.html) from post to get, and retrieve the values by changing $_POST to $_GET in send.php. The reasons why you&#8217;d want to do this will be discussed when we cover arrays, later on.</p>
<h3>And Now For Something Completely Different</h3>
<p>Actually, that&#8217;s a lie. It&#8217;s pretty much the same. Only this time, we&#8217;re going to have a more intelligent form.</p>
<p>First off, let&#8217;s create the new form. This is basically the same as the one before, except we call the value we&#8217;re inputting &#8216;guess&#8217;.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;html&gt;
&lt;head&gt;
	&lt;title&gt;Deep Thought&lt;/title&gt;
	&lt;meta name=&quot;description&quot; content=&quot;Calculates the answer to life, the universe and everything&quot;/&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;style.css&quot; /&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;div id=&quot;wrapper&quot;&gt;
		&lt;form action=&quot;deepthought.php&quot; method=&quot;post&quot;&gt;
			&lt;label for=&quot;input&quot; class=&quot;label&quot;&gt;Enter a number:&lt;/label&gt;
			&lt;input type=&quot;text&quot; name=&quot;guess&quot; size=&quot;30&quot;&gt;
			&lt;input type=&quot;submit&quot; value=&quot;Is it the answer?&quot; class=&quot;button&quot;&gt; 
		&lt;/form&gt;
	&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>We&#8217;ll use the same style.css file we used before. Which means all that&#8217;s left to do is create the actual script to process the form again. This time, it&#8217;s called deepthought.php. Before we create it though, here&#8217;s a short description of what it should do.</p>
<p>The form, if all goes well, should take the number that we&#8217;ve input, and compare it to a given value. If it&#8217;s lower, it should say &#8220;This is NOT the answer to Life, The Universe and Everything. It&#8217;s too small!&#8221;. If it&#8217;s bigger, it should say &#8220;This is NOT the answer to Life, The Universe and Everything. It&#8217;s too big!&#8221;. And if it&#8217;s the same, it should say &#8220;Congratulations! You&#8217;ve found the answer to Life, The Universe and Everything!!!&#8221;</p>
<p>Now we know what we&#8217;re going to build, let&#8217;s build it!</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// Assign the answer to Life, The Universe and Everything</span>
<span style="color: #000088;">$answer</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">42</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">// Get the data from the form...</span>
<span style="color: #000088;">$guess</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="">'guess'</span><span style="color: #009900;">&#93;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">// Check the guess against the answer, and tell us what you think, oh might Deep Thought</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$guess</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$answer</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;This is NOT the answer to Life, The Universe and Everything. It's too big!&quot;</span>;
	<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$guess</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$answer</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;This is NOT the answer to Life, The Universe and Everything. It's too small!&quot;</span>;
	<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$guess</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$answer</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;Congratulations! You've found the answer to Life, The Universe and Everything!!!&quot;</span>;
	<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;You entered something that wasn't a number, you moron!&quot;</span>;
	<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Heer, we&#8217;re using the if, elseif and else statements to create our answer. We build if and elseif statements using the following syntax: </p>
<p><em>(value1 operator value2) { do something here }</em></p>
<p>&#8230;however, else statements just get </p>
<p><em>{ do something here }</em></p>
<p>&#8230;as they aren&#8217;t having to compare anything.</p>
<p>As such, this script is doing exactly whatit looks like. If you&#8217;re feeling a bit slow however, here&#8217;s the logic:</p>
<ol>
<li>Set The Answer as 42</li>
<li>Get the person&#8217;s number, and call it &#8216;guess&#8217;</li>
<li>Check if guess is more than answer, output the first response</li>
<li>If that wasn&#8217;t right, then check if guess is less than answer, output the second response</li>
<li>If that wasn&#8217;t right, then check if guess is the same as the answer, output the third response</li>
<li>If none of those were right, then point out that they didn&#8217;t enter a number and insult them</li>
</ol>
<p>Note that you don&#8217;t need to have elseif or even else statements to make these work. The else simply provides a default value. As such, we could just run four if statements.</p>
<h3>Moving Onwards</h3>
<p>Tomorrow we&#8217;ll take a look at some more operators, scripts and controls, and build some more wild and wonderful things using control structures.</p>
]]></content:encoded>
			<wfw:commentRss>http://searchlightdigital.com/php-for-dummies-its-all-about-your-form/feed</wfw:commentRss>
		</item>
		<item>
		<title>PHP For Dummies Part 2: Do the Maths</title>
		<link>http://searchlightdigital.com/php-for-dummies-do-the-maths</link>
		<comments>http://searchlightdigital.com/php-for-dummies-do-the-maths#comments</comments>
		<pubDate>Mon, 05 Jan 2009 12:03:32 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
		
		<category><![CDATA[php]]></category>

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

		<guid isPermaLink="false">http://searchlightdigital.com/?p=395</guid>
		<description><![CDATA[In this second part of our tutorial series, we&#8217;re going to look at the maths functions PHP includes. In the third, we&#8217;ll look at forms.
Calculate This!
When you get right down to it, most PHP scripts, forms or functions are doing maths. It might not always be with numbers, but the principles remain the same. As [...]]]></description>
			<content:encoded><![CDATA[<p>In this second part of our tutorial series, we&#8217;re going to look at the maths functions PHP includes. In the third, we&#8217;ll look at forms.</p>
<h3>Calculate This!</h3>
<p>When you get right down to it, most PHP scripts, forms or functions are doing maths. It might not always be with numbers, but the principles remain the same. As such, a good working knowledge of PHPs maths operators is a good idea. So let&#8217;s look at an example, and see what it&#8217;s doing.</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">//How many units we had</span>
<span style="color: #000088;">$total</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1000</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">//How many units we sold</span>
<span style="color: #000088;">$sold</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">15</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">//How many units we have now</span>
<span style="color: #000088;">$newtotal</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$total</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$sold</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">//How many units are arriving tomorrow</span>
<span style="color: #000088;">$incoming</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">25</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">//How many units will we have tomorrow</span>
<span style="color: #000088;">$futuretotal</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$newtotal</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$incoming</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">// How many did we sell, as a percentage of our incoming stock?</span>
<span style="color: #000088;">$difference</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$incoming</span> <span style="color: #339933;">/</span> <span style="color: #000088;">$sold</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">//And if we sold the same number every day for 21 days without restock, how many would we have?</span>
<span style="color: #000088;">$multiplied</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$futuretotal</span> <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$sold</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">21</span><span style="color: #009900;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>As you can see in the code above, we&#8217;re assigning values for a basic stock keeping system. We&#8217;ve got how many units of something we had in stock, how many we&#8217;ve sold, and then we&#8217;ve calculated how many we&#8217;ll have now, by taking away one from the other. We&#8217;ve then gone on to add new stock, work out how much we sold compared to what we&#8217;ve got coming in, and predict future stock levels.</p>
<p>With all these, the important thing to remember is to space things out. You should have a space before and after every operator (+, -, /, * etc).</p>
<p>You can also run some things simultaneously. For instance, rather than writing the following:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$a</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">10</span>;
<span style="color: #000088;">$b</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">15</span>;
&nbsp;
<span style="color: #000088;">$a</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$a</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$b</span> <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$a</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>&#8230;which would change the value of a to be 17, we can write&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$a</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">10</span>;
<span style="color: #000088;">$b</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">15</span>;
&nbsp;
<span style="color: #000088;">$a</span> <span style="color: #339933;">+=</span> <span style="color: #000088;">$b</span> <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$a</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>&#8230;instead. Not only is this easier to read, due to needing fewer brackets, it&#8217;s also a huge boon when you&#8217;re working with very large scripts, as you can trim down the time taken to write and debug them. It&#8217;s a bit counter-intuitive at first, but you get used to it!</p>
<p><strong>Concatenation? Something to do with cats&#8230;</strong></p>
<p>Concatenation is a long word that basically means adding two things together, but not in value. The operator for it is the period symbol. However, as this description sucks, I&#8217;ll illustrate it with an example that should help.</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$a</span> <span style="color: #339933;">=</span> <span style="">'Concat'</span>;
<span style="color: #000088;">$b</span> <span style="color: #339933;">=</span> <span style="">'enation'</span>;
&nbsp;
<span style="color: #000088;">$sentence</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$a</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$b</span>;
&nbsp;
<span style="color: #990000;">echo</span> <span style="color: #000088;">$sentence</span>;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>This would print out <em>Concatenation</em>. Another example would be:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$a</span> <span style="color: #339933;">=</span> <span style="">'This'</span>;
<span style="color: #000088;">$b</span> <span style="color: #339933;">=</span> <span style="">'is'</span>;
<span style="color: #000088;">$c</span> <span style="color: #339933;">=</span> <span style="">'concatenation!'</span>;
&nbsp;
<span style="color: #000088;">$sentence</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$a</span><span style="color: #339933;">.</span><span style="color: #000088;">$b</span><span style="color: #339933;">.</span><span style="color: #000088;">$c</span>;
&nbsp;
<span style="color: #990000;">echo</span> <span style="color: #000088;">$sentence</span>;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>When run, this would print out <em>This is concatenation!</em>. However, with this one, we can introduce an important change to make things faster.</p>
<p>Unfortunately, when you run the above script, PHP does a new concatenation for every period. This means we&#8217;re doing four separate concatenations. However, there is a faster way. If we reform this statement to look like:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$a</span> <span style="color: #339933;">=</span> <span style="">'This'</span>;
<span style="color: #000088;">$b</span> <span style="color: #339933;">=</span> <span style="">'is'</span>;
<span style="color: #000088;">$c</span> <span style="color: #339933;">=</span> <span style="">'concatenation!'</span>;
&nbsp;
<span style="color: #000088;">$sentence</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;$a $b $c&quot;</span>;
&nbsp;
<span style="color: #990000;">echo</span> <span style="color: #000088;">$sentence</span>;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>&#8230;that, then PHP actually does the whole thing in one go. This way, we also get to add the spaces directly into the string, which makes it easier to read too.</p>
<h3>Take Care While Operating</h3>
<p>If you want to know all the operators and what they do, here&#8217;s the list:</p>
<table class="styledtable">
<tr>
<th>Operator</th>
<th>Function</th>
</tr>
<tr>
<td>=</td>
<td>Assignment</td>
</tr>
<tr>
<td>=</td>
<td>Assignment</td>
</tr>
<tr>
<td>+</td>
<td>Addition</td>
</tr>
<tr>
<td>-</td>
<td>Subtraction</td>
</tr>
<tr>
<td>*</td>
<td>Multiplication</td>
</tr>
<tr>
<td>/</td>
<td>Division</td>
</tr>
<tr>
<td>%</td>
<td>Modulus (Remainders. 10 % 7 = 3 etc)</td>
</tr>
<tr>
<td>++</td>
<td>Increment</td>
</tr>
<tr>
<td>+=</td>
<td>Increment Assignment</td>
</tr>
<tr>
<td>-=</td>
<td>Decrement Assignment</td>
</tr>
<tr>
<td>*=</td>
<td>Multiply Assignment</td>
</tr>
<tr>
<td>.</td>
<td>Concatenate</td>
</tr>
<tr>
<td>()</td>
<td>Parenthese (Do what&#8217;s in this first)</td>
</tr>
<tr>
<td>!</td>
<td>Not</td>
</tr>
<tr>
<td>==</td>
<td>Equals</td>
</tr>
<tr>
<td>></td>
<td>Greater than</td>
</tr>
<tr>
<td><</td>
<td>Less than</td>
</tr>
<tr>
<td>>=</td>
<td>Greater than or equal to</td>
</tr>
<tr>
<td><=</td>
<td>Less than or equal to</td>
</tr>
<tr>
<td>!=</td>
<td>Not equal</td>
</tr>
<tr>
<td>&#038;&#038;<br/><br />
			and</td>
<td>Both statement $a &#038;&#038; $b are true</td>
</tr>
<tr>
<td>||<br/><br />
			or</td>
<td>Either statement $a || $b is true.</td>
</tr>
<tr>
<td>xor</td>
<td>Exclusion or (Either one or other is true, not both)</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://searchlightdigital.com/php-for-dummies-do-the-maths/feed</wfw:commentRss>
		</item>
		<item>
		<title>Make the WordPress 2.7 Interface Prettier in 120 Seconds</title>
		<link>http://searchlightdigital.com/make-the-wordpress-27-interface-prettier-in-120-seconds</link>
		<comments>http://searchlightdigital.com/make-the-wordpress-27-interface-prettier-in-120-seconds#comments</comments>
		<pubDate>Fri, 02 Jan 2009 19:18:01 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
		
		<category><![CDATA[design]]></category>

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

		<guid isPermaLink="false">http://searchlightdigital.com/?p=388</guid>
		<description><![CDATA[Want to make the interface prettier? Here&#8217;s what you do&#8230;

Open your favourite FTP program
Find the following file: wpadmin/css/colors-fresh.css
Open it in your favourite text editor
Do a find replace, changing -33px; to -1px;
Save, update the server version and close

All those pants dull grey icons will now be the pretty full colour versions instead. Isn&#8217;t that better? Alternatively, [...]]]></description>
			<content:encoded><![CDATA[<p>Want to make the interface prettier? Here&#8217;s what you do&#8230;</p>
<ol>
<li>Open your favourite FTP program</li>
<li>Find the following file: wpadmin/css/colors-fresh.css</li>
<li>Open it in your favourite text editor</li>
<li>Do a find replace, changing -33px; to -1px;</li>
<li>Save, update the server version and close</li>
</ol>
<p>All those pants dull grey icons will now be the pretty full colour versions instead. Isn&#8217;t that better? Alternatively, you can download ours <a href="http://searchlightdigital.com/wp-admin/css/colors-fresh.css">here</a>.</p>
<p>Oh, and if you want a prettier image for the logo in the top left hand corner, try <a href="http://searchlightdigital.com/wp-admin/images/wp-logo.gif">this one</a>. It&#8217;s a replacement for wp-admin/images/wp-logo.gif</p>
<p><a href="http://searchlightdigital.com/images/blog/wp-dash/wp-dash-full.png"><img src="http://searchlightdigital.com/images/blog/wp-dash/wp-dash.png" alt="The modified WP dashboard" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://searchlightdigital.com/make-the-wordpress-27-interface-prettier-in-120-seconds/feed</wfw:commentRss>
		</item>
		<item>
		<title>Dear World: Stop Reading, Start Doing</title>
		<link>http://searchlightdigital.com/dear-world-stop-reading-start-doing</link>
		<comments>http://searchlightdigital.com/dear-world-stop-reading-start-doing#comments</comments>
		<pubDate>Fri, 02 Jan 2009 15:21:35 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://searchlightdigital.com/?p=352</guid>
		<description><![CDATA[The title of this post might strike people as being a bit odd. For one, this is a blog, and we regularly cover how-to related topics, so why would we be essentially telling you to stop reading our us?
Well, it comes down to this: What most people need is not more information, just more practice.
It&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>The title of this post might strike people as being a bit odd. For one, this is a blog, and we regularly cover how-to related topics, so why would we be essentially telling you to stop reading our us?</p>
<p>Well, it comes down to this: What most people need is not more information, just more practice.</p>
<p>It&#8217;s really not rocket science. Why don&#8217;t your linkbuilding campaigns go huge? Maybe because the linkbait you&#8217;re creating is rubbish. Why aren&#8217;t you hitting the homepage of Digg? Perhaps it&#8217;s because the Digg crowd think that actually your content sucks.</p>
<p>Please people, stop reading articles on How to Use Twitter or 29 Ways You Too Can Get Links to Sphinn. Stop encouraging people to tell you how to write great title tags, or the same old stuff over and over again. You don&#8217;t need to learn that stuff. You already know it. What you <em>need</em> is to do more linkbait, build more sites, learn more code.</p>
<p>If you want to code better CSS, sure, go read some articles. But then go and code some CSS. If you want to be a better parent, go read a guide for sure, but then how about actually spending some time with your kids? If you want to lose weight and get fit, find out about having a healthy diet and calisthenics and running and all that jazz, but then actually do it. And not just today, but every day.</p>
<p>If you want a resolution for 2009, try this one: I will learn about things, and then I&#8217;ll spend a lot more time actually doing those things; putting them into practice.</p>
<p>Information is great. But don&#8217;t let it be a substitute for action.</p>
]]></content:encoded>
			<wfw:commentRss>http://searchlightdigital.com/dear-world-stop-reading-start-doing/feed</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.998 seconds -->
<!-- Cached page served by WP-Cache -->
