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

<channel>
	<title>Eric</title>
	<atom:link href="http://www.the-arcanist.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.the-arcanist.com</link>
	<description>Internet...Revealed</description>
	<pubDate>Wed, 12 Nov 2008 09:15:18 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Athlon 64 X2 5000+ Dual Core Processor -$54.00 AR</title>
		<link>http://www.the-arcanist.com/hot-deals/athlon-64-x2-5000-dual-core-processor-5400-ar.html</link>
		<comments>http://www.the-arcanist.com/hot-deals/athlon-64-x2-5000-dual-core-processor-5400-ar.html#comments</comments>
		<pubDate>Wed, 12 Nov 2008 08:54:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Hot Deals]]></category>

		<guid isPermaLink="false">http://www.the-arcanist.com/?p=19</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>Athlon 64 X2 5000+ Dual Core Processor -$54.00 (after promo code &#8220;AMD1135&#8243;) at Newegg.com, expires 11/30</p>
<p><a href="http://www.the-arcanist.com/affiliate-marketing/athlon-64-x2-5000-dual-core-processor-5400-after-promo-code-amd1135-at-neweggcom-expires-1130" target="_blank">Link<br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.the-arcanist.com/hot-deals/athlon-64-x2-5000-dual-core-processor-5400-ar.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>MySQL Database Class Design Using The Singleton Pattern</title>
		<link>http://www.the-arcanist.com/web-programming/mysql-database-class-design-using-the-singleton-pattern.html</link>
		<comments>http://www.the-arcanist.com/web-programming/mysql-database-class-design-using-the-singleton-pattern.html#comments</comments>
		<pubDate>Tue, 09 Sep 2008 09:07:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Web Programming]]></category>

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

		<category><![CDATA[design pattern]]></category>

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

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

		<category><![CDATA[singleton pattern]]></category>

		<guid isPermaLink="false">http://www.the-arcanist.com/?p=18</guid>
		<description><![CDATA[If you read my previous blogs, I stated that using a single connection to the database can help keep database streams to a minimum.  Of course, no matter what, getting all of you the information you want once per page call would be key.  If you are not running memcache or other programs to aid [...]]]></description>
			<content:encoded><![CDATA[<p>If you read my previous blogs, I stated that using a single connection to the database can help keep database streams to a minimum.  Of course, no matter what, getting all of you the information you want once per page call would be key.  If you are not running memcache or other programs to aid in keeping database calls to a minimum, having a class cache all you queries per page might be beneficial to help keeps hits to a possible low.  Some pages require more interaction than others, and some might require the same call multiple times to get the information it needs to construct the page.</p>
<p>For those of you who rather construct your own database class, using a Singleton pattern would of course be the way to go.  Instead of creating hundreds of instances of the same class, the Singleton pattern will verify to see if a connection has been made, and if so, return the existing connection.</p>
<p>Traditionally, you would start your class like so&#8230;</p>
<p>class database{<br />
public function __construct() {};<br />
}</p>
<p>and you would call on the class as such:</p>
<p>$db = new database;</p>
<p>When using a singleton pattern, your connection would be slightly different:</p>
<p>class database {<br />
private static $instance;<br />
private $connection;</p>
<p>private function __construct() {<br />
$this-&gt;initiate_connection();<br />
}</p>
<p>public static function get_instance() {<br />
if( !self::$instance ) {<br />
self::$instance = new __CLASS__;<br />
}</p>
<p>return self::$instance;<br />
}<br />
}</p>
<p>Now to call this would be a simple:</p>
<p>$database = database::get_instance();</p>
<p>and you have your connection.  But did you see what happened in get_instance?  first it checked to see if the instance was already created, if it has been, then it returns the already created instance to whatever is calling it.  If not, then it creates the instance, and returns that instance.</p>
<p>Now for the fun part, using it to keep a persistant connection.  If you noticed the construct method called $this-&gt;initiate_connection().  The function initiate_connection will by your code to create the connection to the database, then store it in the global variable $connection.  Now your connection is available to all functions in your class.</p>
<p>you can program initiate_connection to be smart, using a simple if statement to check for new credentials, or using default credentials, you can use your class to manage and cache multiple database connections.</p>
<p>For instance:</p>
<p>private function initiate_connection()<br />
{<br />
// check for a special connection, if so use special connection to create the connection.  if not use default connection.</p>
<p>$this-&gt;connection['connection_name'] = //your new connection;<br />
}</p>
<p>as you can see, $this-&gt;connection is an array of objects.  this will allow you to hold multiple db connections under one class, and allow you to access them through a special name that you give that connection.  You can define new connections by writin a function to set them:</p>
<p>public function database( $db, $user, $pass, $host, $name )<br />
{<br />
$this-&gt;connection[$name] = mysql_pconnect( $host, $user, $pass);<br />
mysq_select_db( $db, $this-&gt;connection[$name] );<br />
}</p>
<p>now you have just defined a new connection.  by setting global variables for special db, host, user, and pass, you can make use of your already created mysql connector initiate_connection.</p>
<p>now you can use any db connection you want by simple letting the class know which connection to use.  You can write a setter function to do so, or define it in your function to execute the query.  For simplistic reasons, we will just define it in the function that the query will be executed in.</p>
<p>public function query( $sql, $connection_name ) {<br />
return mysql_query( $sql, $this-&gt;connection[$connection_name] );<br />
}</p>
<p>Now you have the raw output of the mysql query for your leisure.  to make this even better by caching the results, create a global variable called $cache and run a check to see if the sql has already been executed, if not, execute and return, or return the already executed query.</p>
<p>public function query( $sql, $connection_name ) {</p>
<p>if( exists( $this-&gt;cache[$sql] ) )<br />
{<br />
return $this-&gt;cache[$sql];<br />
}<br />
else<br />
{<br />
$result = mysql_query( $sql, $this-&gt;connection[$connection_name] );<br />
$this-&gt;cache[$sql] = $result;<br />
return $result;<br />
}<br />
}</p>
<p>now you have a cached copy of the sql statement saved to be used else where on the page if you need to.  since this is sql specific, no matter which database connection you use, it will always return the appropriate cached copy.</p>
<p>The end result, you should have a single class that will manage multiple db connections, cache the connection as well as cache all sql statements performed per page to ensure minimal usage of the actual database.  Using the singleton pattern ensures that the class is not created multiple times, and you can actually create the method __clone() to ensure this class cannot be cloned to avoid to many unnecessary connections to your database.  Your final code should look something like this.</p>
<p>class database {<br />
private static $instance;<br />
private $connection = array();<br />
private $cache = array();</p>
<p>private function __construct() {<br />
$this-&gt;initiate_connection();<br />
}</p>
<p>public static function get_instance() {<br />
if( !self::$instance ) {<br />
self::$instance = new __CLASS__;<br />
}</p>
<p>return self::$instance;<br />
}</p>
<p>private function initiate_connection()<br />
{<br />
$this-&gt;connection['default'] = mysql_pconnect( $host, $user, $pass);<br />
mysq_select_db( $db, $this-&gt;connection['default'] );<br />
}</p>
<p>public function database( $db, $user, $pass, $host, $name )<br />
{<br />
$this-&gt;connection[$name] = mysql_pconnect( $host, $user, $pass);<br />
mysq_select_db( $db, $this-&gt;connection[$name] );<br />
}</p>
<p>public function query( $sql, $connection_name ) {</p>
<p>if( exists( $this-&gt;cache[$sql] ) )<br />
{<br />
return $this-&gt;cache[$sql];<br />
}<br />
else<br />
{<br />
$result = mysql_query( $sql, $this-&gt;connection[$connection_name] );<br />
$this-&gt;cache[$sql] = $result;<br />
return $result;<br />
}<br />
}<br />
}</p>
<p>How to use:</p>
<p>$db = databae::get_instance();<br />
$db-&gt;database( &#8216;db1&#8242;, &#8216;user&#8217;, &#8216;pass&#8217;, &#8216;192.168.0.100&#8242;, &#8216;mySpecialConnection&#8217; );<br />
$query1 = $db-&gt;query( &#8217;select * from table1 where firstname = &#8220;john&#8221;, &#8216;primary&#8217; );<br />
$query2 = $db-&gt;query( &#8217;select * from table3 where pet = &#8220;cat&#8221;, &#8216;mySpecialConnection&#8217; );<br />
$query3 = $db-&gt;query( &#8217;select * from table1 where lastname = &#8220;smith&#8221;, &#8216;primary&#8217; );<br />
$query4 = $db-&gt;query( &#8217;select * from table4 where fish = &#8216;tiger oscar&#8217;, &#8216;mySpecialConnection&#8217; );</p>
<p>now you have a bunch of queries off of multiple databases, off of one class with virtually one connection.  All results are cached until you move to the next page, so if you so need them, they are already available to you.  Makes your life easier, and your database connection more efficient.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.the-arcanist.com/web-programming/mysql-database-class-design-using-the-singleton-pattern.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Search Engine Friendly JavaScripting</title>
		<link>http://www.the-arcanist.com/search-engine-optimization/search-engine-friendly-javascripting.html</link>
		<comments>http://www.the-arcanist.com/search-engine-optimization/search-engine-friendly-javascripting.html#comments</comments>
		<pubDate>Sun, 06 Jul 2008 04:06:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

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

		<category><![CDATA[search engine optimization]]></category>

		<category><![CDATA[search engine friendly javascript]]></category>

		<guid isPermaLink="false">http://www.the-arcanist.com/?p=17</guid>
		<description><![CDATA[In the &#8220;old days&#8221;, using JavaScript to enhance your site was not a recommended thing to do when going for search engine optimization.  Javascript often times  added a lot of code to the page that blocked many search engines from reading the content, produced rollover links that were not readable to a search engine spider, [...]]]></description>
			<content:encoded><![CDATA[<p>In the &#8220;old days&#8221;, using JavaScript to enhance your site was not a recommended thing to do when going for search engine optimization.  Javascript often times  added a lot of code to the page that blocked many search engines from reading the content, produced rollover links that were not readable to a search engine spider, and weighed down the page giving the page a low content to code ratio.</p>
<p>Now days, with the recognition of the importance of search engine optimization, new ways of using JavaScript has been implemented to allow rollover links and other various effects to be readable by search engines.  Not necessarily does JavaScript produce the code on the demand, the combination of using CSS and JavaScript together allows &#8220;dynamic&#8221; content to be produced, as well as &#8220;dynamic links&#8221;.  Note that I quote them.  The content and links in fact are not dynamic and hard coded into the HTML page, however using CSS and div tags, you can hide the div until it is ready to display.  Using DOM and JavaScript, you can call on these div tags, manipulate the CSS to grab the content or links and display at your leisure.</p>
<p>This will allow the ability to still have the content and links visible to the search engine spiders, yet give your site more options as far as looking modern or cutting edge.  There are a lot of good open source packages out there that do this.  One of the most common is <a title="script.aculo.us" href="http://www.script.aculo.us">script.aculo.us</a>. Script.aculo.us allows animated effects to your site, making it more cutting edge.</p>
<p>There are other ways of using JavaScript and other open source packages to achieve various effects to enhance your site.  My portofolio site <a title="ZenCreatives.com" href="http://www.zencreatives.com">zencreatives.com</a> uses a lot of open source JavaScript packages and CSS to produce various effects, yet making the page completely readable by a search engine.</p>
<p>Also a thing to note, all the JavaScript is kept in a seperate JS file.  You do not want code on your page that is not necessary.  This will wieght down your page, not to mention, to much JavaScript can keep a search engine spider from wanting to crawl the rest of your site.</p>
<p>Some time in the near future, I will put up working code samples and using open source packages to show you how it can be done.  Not to mention I will show you how to tweak open source packages to achieve other effects that you may need.  If you have any questions as to how to do something, feel free to leave a comment, and I will compile a list to make tutorials on.  I will create them as I recieve requests or the ones that are most commonly needed.  So stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.the-arcanist.com/search-engine-optimization/search-engine-friendly-javascripting.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>The Nitty Gritty Of A Site For Search Engine Optimization</title>
		<link>http://www.the-arcanist.com/internet-marketing/the-nitty-gritty-of-a-site-for-search-engine-optimization.html</link>
		<comments>http://www.the-arcanist.com/internet-marketing/the-nitty-gritty-of-a-site-for-search-engine-optimization.html#comments</comments>
		<pubDate>Fri, 04 Jul 2008 19:58:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Internet Marketing]]></category>

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

		<category><![CDATA[search engine optimization]]></category>

		<guid isPermaLink="false">http://www.the-arcanist.com/?p=15</guid>
		<description><![CDATA[Search engine optimization isn&#8217;t hard to do or learn.  Some basic stuff in web development goes a long way.  The basics believe it or not work wonders when trying to get your site into the search engines.  But first you have to determine, how badly do you want to be in search engines, and how [...]]]></description>
			<content:encoded><![CDATA[<p>Search engine optimization isn&#8217;t hard to do or learn.  Some basic stuff in web development goes a long way.  The basics believe it or not work wonders when trying to get your site into the search engines.  But first you have to determine, how badly do you want to be in search engines, and how badly do you want to fanazzle your viewer.  Unfortunately, for search engine optimization, the bells and whistles often times hurt your rankings.  When planning for search engines, the best thing to do is go back to the basics pre javascript era when the world wide web was still only for the selected few.</p>
<p>Using Javascript can be used and yet still achieve search engine optimization, however, flash will not get ranked.  And this is important to know.  What is your goal for your site?  Knowing this will be key.  Ranking in search engines is a process that takes time to achieve.  White hat SEO does not happen over night, or even months.  Often time to get good quality rankings, you need atleast 6 months, and so much goes into what factors your score.</p>
<p>Time your site has been &#8220;alive&#8221; plays a key factor.  If you domain is brand new, chances are, your site will take forever and a day to get ranked.  New sites have not established any relevancy to the internet world in the search engine spider&#8217;s eyes.  However, at the same token, and brand new domain might be easier to get into the search engine.  Old domains that may been optimized using black hat techniques might have been band or label, virtually making it imposible to rankings.  A brand new domain has no history, therefore it&#8217;s history will be built.  If you do things correctly, the search engines will love you, and before you know it, natural traffic will be on your way.</p>
<p>When building a brand new domain, it is better to build it small, then expand.  This gives it time for the search engine spiders to see a natural growth of the site.  Constantly adding new content keeps the spider hungry for more and coming back.</p>
<p>Targeting each pages to specific keywords or phrases is key. No more than 3 should be used on any given page.  Content should be written specifically for it.  Use proper english, however in the case of search engines, repeating keywords and phrases will not get you slapped on the hand by your english teacher.  Repeat the keywords.  Use them as much as possible, but make sure it is still gramatically correct and understandable to a human reader.  Try and keep content to approx. 300 words or roughly 3 paragraphs.</p>
<p>Use meta keyword and description tags.  Do not spam the keyword.  Make each page unique.  Try not to repeat the same keyword more than 5 times.</p>
<p>Use the keywords in an H1 and title tag in the HTML.  Proper usage of HTML tags is very important.  The days of using the tag to best achieve the look is out.  Use CSS to redefine the look of the HTML attribute or tag.  Keep your HTML code to a minimum.  Stay away from the table development, and stick more to div tags.  Keep all styling in a seperate CSS file.  Creating a pure CSS page will make a big difference in how the search engines favor your site.  Often times the pages are lighter, and the code is easier to read.</p>
<p>Images, keep the design images in the CSS file, and only include necessary images named after the keyword targeted for the page.  The name of the image must make sense to the image itself.  Proper usage of &#8220;Alt&#8221; tags on the images is a good idea.  Remember, what the search engine spiders want to see, is a properly formated site, this includes the content and the code.</p>
<p>Make sure all links on the site are readable.  Use title attributes on &#8220;a&#8221; tags.  If any javascript is used for rollover effects, make sure the link is still readable, and keep the javascript on a js file seperate from the page.</p>
<p>Page naming convention and folder structure.  Make sure the name is named to the keyword or phrase, and logically stored in the appropriate folder.  You would not store a page called &#8220;widgets&#8221; in a folder named &#8220;cars&#8221;.  Chances are, you will store a page named &#8220;Ford Mustang&#8221; in a folder named &#8220;cars&#8221;.  Usage of folder structures is critical when targeting main keyphrases and the sub targeting specific key phrases and keywords.  Keep your folder structure to a minimum.  It is not advisable to go in to deep.  Try and not pass more than 2 tiers deep.  Example:  somewhere.com/cars/ford-mustang.html is idea.  This is not: somewhere.com/cars/ford/mustang.html.  This is to many folders in deep and chances are, the page mustang will not be seen and put on to the back burner for another time.</p>
<p>Backward links is very important.  There are 2 types of links.  One way links, and two links.  One way links rank higher than two way links.  It is known that two way links are used in link building, and that two sites agree to have each other&#8217;s link on their site for the purposes of search engine optimization.  Better links are one way links.  Usually when someone finds a good read, they will naturally link to the site.  Search engines know this.  If you have a one way link to your site, and you have a lot of them, chances are, the content is good, and relevent to what the user is searching for.</p>
<p>As of now, search engines rely heavily on links to your site to tell them how you should be ranked.  The more links going back to your site, the better you will position.  A linking campaign is crucial when building for search engines.</p>
<p>Last thing, your site&#8217;s theme.  All sites have a theme.  The theme of this blog is everything about the internet.  Not much outside of the internet will be discussed.  Your site should have a theme too.  Without a theme, search engine&#8217;s will not know how to rank you or what to rank you for.  If your theme is cars, but you write or the spider interprets your content as planes, you have a big problem.  Using tools to figure out what your site&#8217;s content gives off is important.  Use them.  They really can drastically improve the ranking of your site.</p>
<p>This is a more in depth approach.  Tweaking an maintaining your site are important.  Tweaking your site often will teach you what little stuff works and what doesn&#8217;t.  A great deal of time will be spent, but if you&#8217;re long term goal is to get natural traffic through your site to help cut marketing costs, you will reap the rewards if you keep at it. Read webmaster forums and search engine optimization forums as much as posssible. Post and ask questions. There is so much free information out there, you just have to go get it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.the-arcanist.com/internet-marketing/the-nitty-gritty-of-a-site-for-search-engine-optimization.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>For Giggles</title>
		<link>http://www.the-arcanist.com/internet-marketing/for-giggles.html</link>
		<comments>http://www.the-arcanist.com/internet-marketing/for-giggles.html#comments</comments>
		<pubDate>Thu, 03 Jul 2008 08:57:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Affiliate Marketing]]></category>

		<category><![CDATA[Internet Finds]]></category>

		<category><![CDATA[Internet Marketing]]></category>

		<category><![CDATA[Pay Per Click]]></category>

		<category><![CDATA[search engine optimization]]></category>

		<category><![CDATA[affiliate network list]]></category>

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

		<category><![CDATA[ppc list]]></category>

		<category><![CDATA[seo lists]]></category>

		<guid isPermaLink="false">http://www.the-arcanist.com/?p=14</guid>
		<description><![CDATA[For Giggles, I thought I would list a bunch of sites and their usefulness for your convience, so here goes.
Search Engine Optimization
http://www.google.com/support/webmasters/bin/answer.py?hl=en&#38;answer=35769 - Google Webmaster Guidelines&#8230;need I say more?
http://www.seochat.com/seo-tools/ - Has a lot of free tools to help you understand what a search engine sees and helps you optimize your site for better rank.
http://tools.seobook.com/ - [...]]]></description>
			<content:encoded><![CDATA[<p>For Giggles, I thought I would list a bunch of sites and their usefulness for your convience, so here goes.</p>
<p><strong>Search Engine Optimization</strong></p>
<p><a title="Google Webmaster Guidelines" href="http://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;answer=35769">http://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;answer=35769</a> - Google Webmaster Guidelines&#8230;need I say more?</p>
<p><a title="SEO Tools" href="http://www.seochat.com/seo-tools/">http://www.seochat.com/seo-tools/</a> - Has a lot of free tools to help you understand what a search engine sees and helps you optimize your site for better rank.</p>
<p><a title="SEO Tools" href="http://tools.seobook.com/">http://tools.seobook.com/</a> - Has some more great tools for running ranking reports on your site and also a very useful keyword selection tool.  Works with WordTracker, and gives you the counts of how many times it was search for the popular search engines.</p>
<p><a title="Keyword Selection Tool" href="http://www.wordtracker.com">http://www.wordtracker.com</a> - Good tool to use when trying to select keywords to target and help and suggestions on other keywords that maybe used to search for your site.</p>
<p><strong>Pay Per Click Advertising</strong></p>
<p><a title="Google Adwords" href="http://adwords.google.com">Google Adwords</a></p>
<p><a title="Yahoo! Search Marketing" href="https://marketingsolutions.login.yahoo.com">Yahoo! Search Marketing</a></p>
<p><a title="Microsoft Adcenter" href="http://adcenter.microsoft.com">Microsoft Adcenter</a></p>
<p><strong>Affiliate Marketing Networks</strong></p>
<p>Hydra Network - <a title="Hydra Network" href="http://network.hydranetwork.com/refer.php?id=26622">http://www.hydranetwork.com</a></p>
<p>Commission Junction - <a title="Commission Junction" href="http://www.cj.com">http://www.cj.com</a></p>
<p>CPA Empire - <a title="CPA Empire" href="http://www.cpaempire.com">http://www.cpaempire.com</a></p>
<p>Link Share - <a title="Link Share" href="http://www.linkshare.com">http://www.linkshare.com</a></p>
<p><strong></strong>More to come!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.the-arcanist.com/internet-marketing/for-giggles.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Building A House In PHP</title>
		<link>http://www.the-arcanist.com/web-programming/building-a-house-in-php.html</link>
		<comments>http://www.the-arcanist.com/web-programming/building-a-house-in-php.html#comments</comments>
		<pubDate>Thu, 03 Jul 2008 08:28:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

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

		<category><![CDATA[Web Programming]]></category>

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

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

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

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

		<guid isPermaLink="false">http://www.the-arcanist.com/?p=13</guid>
		<description><![CDATA[PHP, though having it&#8217;s limitations, has grown into a vast and robust language of choice by many developers, including myself.  PHP5 when initially released back in 2006, offered a true Object Oriented experience.  Yet to this day, I still find that many PHP develpers are not using the true capabilities that PHP has to offer.  [...]]]></description>
			<content:encoded><![CDATA[<p>PHP, though having it&#8217;s limitations, has grown into a vast and robust language of choice by many developers, including myself.  PHP5 when initially released back in 2006, offered a true Object Oriented experience.  Yet to this day, I still find that many PHP develpers are not using the true capabilities that PHP has to offer.  Frameworking in PHP is not only ideal, but offers a great amount of flexibility and power to drive any system.  Granted, not all sites will need a robust framework, having a psuedo framework in place is still idea.</p>
<p>The days of inter-twining PHP and HTML should be something of the past, yet I find many still do it.  Even without creating a J2EE Framework, a small psuedo framework could be something that will help you rapidly deploy the site in a matter of days to a week.  Like most mainstream software engineering is concerned, you have several layers.  You will have the view or graphical interface layer, the database abstraction layer, and the processing layer.  Properly setting up classes and objects to handle each layer can greatly improve speed, reliability, and ease of trouble shooting.</p>
<p>Mixing PHP and HTML makes the code hard to read, hard to understand, and sends you on a needle in a haystack hunt trying to find the break.  Creating a templating layer that will read a template and combined with the processing layer can help you easily find a break when it comes to visual.  You basically know it will be in one of those components.  If you are smart, you will incorporate a debug mode to all of your classes that you can verbose out all information that is being processed and how it is being processed.  The only layer that should ever talk to the visual layer is the constructor page and the content processing layer.  Even then they really don&#8217;t need to talk.  The visual object or layer should only have to deal with the visual aspects.  The content processing layer should only have to work with the database layer to get the content ready to be inserted into the visual layer.</p>
<p>This will provide a basic framework that you can use through out all sites that will make it easier to deploy and rapidly deploy sites that do not need the power of an actual framework.  The typical core objects I usually have are the template class, and the content class.  Though the content class will usually be broken up into it&#8217;s own classes and subclasses based on the function of the particular page or data being processed.  The template class is basically just that.  It will grab a template, insert the necessary data, and return.  Lately I have been using PDO as a the database layer.  If you have ready my previous post on a better way of using a database object, then you already know that I initiate the database object in an autoload page, and then make that object readily available to all classes.  It cuts database tunnels to only one, and i believe is more efficient on resources.  Not to mention it makes things a whole lot easier.</p>
<p>It provides flexibility in changing templates on the fly, keeps the data where it belongs, and it makes the code easier to read.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.the-arcanist.com/web-programming/building-a-house-in-php.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>A Look Into The Past&#8230;The Evolution Of A Website</title>
		<link>http://www.the-arcanist.com/internet-finds/a-look-into-the-pastthe-evolution-of-a-website.html</link>
		<comments>http://www.the-arcanist.com/internet-finds/a-look-into-the-pastthe-evolution-of-a-website.html#comments</comments>
		<pubDate>Wed, 02 Jul 2008 20:29:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Internet Finds]]></category>

		<category><![CDATA[alexa wayback machine]]></category>

		<category><![CDATA[wayback machine]]></category>

		<category><![CDATA[website history]]></category>

		<guid isPermaLink="false">http://www.the-arcanist.com/?p=12</guid>
		<description><![CDATA[Many may not know this, but Alexa has a progroam called &#8220;The Wayback Machine&#8221;.  You can actually see how a website looked in the past.  It notes significant changes in layout and content.  This is one of those things that may not be all that interesting, but when bored, it does kill a lot of [...]]]></description>
			<content:encoded><![CDATA[<p>Many may not know this, but <a title="Alexa.com" href="http://www.alexa.com">Alexa</a> has a progroam called &#8220;The Wayback Machine&#8221;.  You can actually see how a website looked in the past.  It notes significant changes in layout and content.  This is one of those things that may not be all that interesting, but when bored, it does kill a lot of time.  It is intresting as a web developer though to see how the evolution of your own personal site has evolved over time.</p>
<p>To use the Wayback Machine, go to Alexa&#8217;s website at <a title="Alexa" href="http://www.alexa.com">http://www.alexa.com</a>.  Type in the name of the domain you wish to see, in the drop down, select &#8220;Site Ranking&#8221;, and hit enter.  Once you have come to the website information page, this will give you a break down of the site, how it ranks and compares to other sites, it&#8217;s importance on the internet, and other information.  On the left hand side, you will see a header saying &#8220;<strong>More to Explore</strong>&#8220;.  Right underneath that will be a link to see how the site looked back in time.  All significant changes are denoted with an asterisks(*) next to the date.</p>
<p>This is an intresting way to kill some time and to take a look into the past and see the evolution of a website.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.the-arcanist.com/internet-finds/a-look-into-the-pastthe-evolution-of-a-website.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Google Adsense For Extra Cash</title>
		<link>http://www.the-arcanist.com/internet-marketing/google-adsense-for-extra-cash.html</link>
		<comments>http://www.the-arcanist.com/internet-marketing/google-adsense-for-extra-cash.html#comments</comments>
		<pubDate>Wed, 02 Jul 2008 09:01:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Internet Marketing]]></category>

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

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

		<category><![CDATA[google adsense]]></category>

		<category><![CDATA[making money with adsense]]></category>

		<category><![CDATA[making money with google adsense]]></category>

		<guid isPermaLink="false">http://www.the-arcanist.com/?p=11</guid>
		<description><![CDATA[There are various ways to make money online.  One of the original and most common methods of making money is through Google Adsense.  Google Adsense has come a long ways from when it first started.  Originally all it did was display ads.   Both text and image banner ads placed by a piece of code you [...]]]></description>
			<content:encoded><![CDATA[<p>There are various ways to make money online.  One of the original and most common methods of making money is through Google Adsense.  Google Adsense has come a long ways from when it first started.  Originally all it did was display ads.   Both text and image banner ads placed by a piece of code you put on to your page or site.</p>
<p>How does it work?  Basically, Google is paying you, the site owner, a small chunk of change to place the ad on your site, and each time someone clicks on the ad, you make money.  For those who are currently using it, the question comes down to, how do I make more money using Google Adsense.  One of the major factors that helps is, more traffic.  The more traffic you have, the more chances of someone clicking the ad.</p>
<p>Google has also introduced a couple of other ways to make money using Adsense.  First, you can incorporate a &#8220;search&#8221; feature to your site powered by Google.   Each time a user searches Google through your site, and they click on an Adwords ad, you will be paid out a portion of that income.  This makes your site more interactive with the user and allows another way of generating income besides the traditional method of getting paid per click.</p>
<p>Another way to make money through Adsense is to use the &#8220;Referrer&#8221; program.   This is much like affiliate marketing in the sense, each time someone clicks on your link to the product, signs up, you will get paid.  There is not much to that.</p>
<p>If you wish not use the other methods of Adsense, it is recommended that you place your Adsense ads in highly visible spots.  It has shown that many users ready left to right, top to bottom, just like a book.  Placing your Adsense Ads in these spots can increase visibility, and help your Adsense performance.  Also, try placing several Adsense ads through out your page.  Try changing the spots the ads are shown, and keep track on which spots are producing more clicks.</p>
<p>If you own more than one domain or site, also try placing the ad on multiple sites.  You can put as many as you would like through one account.  The more visitors that sees your Adsense ad, the better chances you have at making extra income though Google Adsense.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.the-arcanist.com/internet-marketing/google-adsense-for-extra-cash.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Newbies Search Engine Optimization Starter And Google</title>
		<link>http://www.the-arcanist.com/internet-marketing/newbies-search-engine-optimization-starter-and-google.html</link>
		<comments>http://www.the-arcanist.com/internet-marketing/newbies-search-engine-optimization-starter-and-google.html#comments</comments>
		<pubDate>Sat, 28 Jun 2008 10:18:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Internet Marketing]]></category>

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

		<category><![CDATA[search engine optimization]]></category>

		<category><![CDATA[get your site in google]]></category>

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

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

		<guid isPermaLink="false">http://www.the-arcanist.com/?p=10</guid>
		<description><![CDATA[Many times over and over the same questions are asked, &#8220;How do I get my site in Google?&#8221;  Well in theory, this is very simple.  Have a good site with a lot of good content.  However, with as many sites as there are in the net, Google has to constantly evolve their ranking algorithm.  Approx. [...]]]></description>
			<content:encoded><![CDATA[<p>Many times over and over the same questions are asked, &#8220;How do I get my site in Google?&#8221;  Well in theory, this is very simple.  Have a good site with a lot of good content.  However, with as many sites as there are in the net, Google has to constantly evolve their ranking algorithm.  Approx. every 6 months, Google does a purge on their system.  Sites that are so so usually don&#8217;t make the cut and get dropped.  Rankings and all.  But can you blame them?  They search millions of sites everyday, constantly finding new ones.  With an indexing system as large as theirs, they have to find a way to maintain a way to keep their databases as efficient as possible.</p>
<p>It has been said that new domains don&#8217;t get ranked, as true as that maybe, I&#8217;ve had plenty of brand new domains start return results within a matter of months.  But what are the criteria on getting your site indexed and cached by Google?  Here are some tips that will surely get you&#8217;re site noticed.</p>
<p>First of all, not all sites will get in.  You must understand that.  What makes a site get in?  HTML coding.  Simple as that.  The downfall to many sites seeking that organic natural rankings fail to properly set their site up with clean HTML code.  When Google and other search engines come in to evaluate your site the first time around, they will usually stick around for the first 10kb of the site.  If the first 10kb of your site is bogged down with code, guess what, the search engine will not find any content, turn around, leave, and throw your site at the end of the list to be read.  This will pretty much ensure the next time Googlebot or other search engines spiders will come around again sometime when boy bands decide to come out of the closet.  HTML coding is one of the most important aspects of Search Engine Optimization that people fail to realize.</p>
<p>Second, read able text links are key.  Search Engines cannot read JavaScript or follow JavaScript links.  So don&#8217;t use them.  If possible, a clean linkshould be used.  Ex.</p>
<p>&lt;a href=&#8221;your_page.html&#8221; title=&#8221;Page Name&#8221;&gt;Page Name&lt;/a&gt;</p>
<p>This link is easily read by search engines.   The &#8220;title&#8221; attribute gives the spider a good idea on what it is to expect.  A good idea, stuff the keyword the end page is targeted towards in that spot.</p>
<p>Third, theme your site.  If your site revolves around &#8220;Widgets&#8221;, make it only about widgets.  Do not try and add other categories to your site, as this will throw off the &#8220;theme&#8221; and drop your chances of getting the main keywords or key phrases targeted.</p>
<p>Fourth, CONTENT!!!! Good quality content with just enough keyword repetition is in order.  Content should be betwen 200 and 300 words, and about 3 paragraphs.  Make sure the content is unique, and actually provides good information to the readers.  No one wants to read or visit a site with useless content.  Most of the stuff on this blog is useless information. <img src='http://www.the-arcanist.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' title="internet-marketing | Newbies Search Engine Optimization Starter And Google | $name" /> But people keep reading it for some reason.  (I know it baffles me off too).  All the content on your page should have a certain amount keyword density and repetition.  You should only target no more than 3 keywords per page.  Keep in mind, you are still going for a theme on the site.   If it is widgets, then stick to widgets.  Do no have content on why the sky is blue.  It has no relevance to widgets and Google will doc you for it.</p>
<p>Fifth, links.  Good content will automatically have links generated back to the page.  This is what you want, and what you are aiming for.  If you don&#8217;t have time to wait around for it, surf the net and find other sites related to your site, and ask for a link exchange.  Be sure before you put their link up on your site, that they put one up for you.  Check back often to ensure they didn&#8217;t take it down.  If they did, you just gave them a one way link.  One way links weight more than 2 way links.  So the idea is to get as many one way links back to your site or landing page.  Often time posting in forums related to you site with your link in the signature works.  Posting in blogs with a link back to your site works too.  I don&#8217;t do it for my site, however, I do it a lot for sites I am promoting.  Not to mention, this drives free traffic to your site, esp if the page has a lot of traffic to it.</p>
<p>Sixth, change your content often.  Make weekly updates if you can. Add pages.  Constantly make changes to your site.  This will keep the spiders hungry ad coming back for more.  This blog gets on average a visit from Googlebot about every 2 days if not everyday.  I personally don&#8217;t see why considering I post to this once a decade, but they seem to like it.  If you can, make daily changes, even if they are small.<br />
Seventh, use a site map.  Have a site map built just for the purposes of having all links in your site in one page.  If you can, use the <a title="Google Webmaster Tools" href="www.google.com/webmasters/start">Google SiteMaps</a> feature to let Google know how often you make changes to your site.</p>
<p>Generally, getting our site into search engines is not hard.  Follow these 7 steps and you should be good.  There are of course a lot of other factors that go with really optimizing a site, however as a starter, these are good steps to follow when trying to get your site noticed by the search engines.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.the-arcanist.com/internet-marketing/newbies-search-engine-optimization-starter-and-google.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>A Better PHP/MySQL Connection</title>
		<link>http://www.the-arcanist.com/web-development/a-better-phpmysql-connection.html</link>
		<comments>http://www.the-arcanist.com/web-development/a-better-phpmysql-connection.html#comments</comments>
		<pubDate>Tue, 24 Jun 2008 17:22:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

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

		<category><![CDATA[Web Development]]></category>

		<category><![CDATA[Web Programming]]></category>

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

		<category><![CDATA[database abstraction layer]]></category>

		<category><![CDATA[database connection]]></category>

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

		<guid isPermaLink="false">http://www.the-arcanist.com/?p=9</guid>
		<description><![CDATA[Keeping heavy loads off of a database can be a tedious task in itself.  Many times multiple instances are created, creating multiple connections to the database that hog resources when in fact only one instance and connection is needed.  With PHP5, database abstraction layers are built into the core.  PDO, although it has it&#8217;s deficiencies, [...]]]></description>
			<content:encoded><![CDATA[<p>Keeping heavy loads off of a database can be a tedious task in itself.  Many times multiple instances are created, creating multiple connections to the database that hog resources when in fact only one instance and connection is needed.  With PHP5, database abstraction layers are built into the core.  PDO, although it has it&#8217;s deficiencies, can be a good starting point for creating a simple database abstraction layer.  However, learning how to use one single instance throughout the life of the page is the key to balancing server load and enhancing performance.</p>
<p>Starting off with a simple &#8220;autoload&#8221; file I find is helpful.</p>
<p>&lt;?php<br />
include( &#8216;autoload.php&#8217; );<br />
?&gt;</p>
<p>The autoload file doesn&#8217;t have to be complicated.  It can be a basic file that creates all instances to be used through out the page, not to mention autoload classes that can be called else where throughout the script.</p>
<p>autoload.php</p>
<p>&lt;?php<br />
include( &#8216;config.php&#8217;);</p>
<p>// loop to auto load class files</p>
<p>/* Single Database initiation to be used throughout the script */</p>
<p>$dsn = &#8220;mysql:host=localhost;dbname=my_database&#8221;;<br />
$dbuser = &#8220;my_database_username&#8221;;<br />
$dbpass = &#8220;my_database_password&#8221;;</p>
<p>$database = new PDO( $dsn, $dbuser, $dbpass );<br />
?&gt;</p>
<p>Typically it is better to define the database info in a global configuration file that will typically not change.  It keeps all important variables that will be used multiple times in one place.  But this autoload file defines the variable $database that will be used throughout the rest of the page.  This will create on instance and most importantly, 1 connection to the database to be used.</p>
<p>On the file that will be needing, not mention allowing class and objects to use this instance can be accomplished this way:</p>
<p>File:</p>
<p>&lt;?php<br />
include( &#8216;autoload.php&#8217;);</p>
<p>$sql = &#8220;select * from my_table&#8221;;</p>
<p>$stmt = $database-&gt;prepare( $sql );<br />
$stmt-&gt;execute();</p>
<p>while( $rows = $stmt-&gt;fetchAll() )<br />
{<br />
// Do Something<br />
}<br />
?&gt;</p>
<p>Passing and allowing usage in objects:</p>
<p>&lt;?php<br />
include( &#8216;autoload.php&#8217; );</p>
<p>$helper = new helper( $database );</p>
<p>echo $helper-&gt;displayView();<br />
?&gt;</p>
<p>The class file:</p>
<p>&lt;?php<br />
class helper<br />
{<br />
private $database;</p>
<p>public function __construct( $database )<br />
{<br />
$this-&gt;database = $database;<br />
}</p>
<p>public function displayView()<br />
{<br />
// do something<br />
$sql = &#8220;some sql statmet&#8221;;<br />
$stmt = $this-&gt;database-&gt;prepare( $sql );<br />
$stmt-&gt;execute();</p>
<p>while( $rows = $stmt-&gt;fetchAll() )<br />
{<br />
// Do something<br />
}<br />
}<br />
?&gt;</p>
<p>As you can see, this allows one single database thread to be used across the entire page freeing resources on the server making it more efficient.</p>
<p>For more information on <a title="PHP PDO" href="http://www.php.net/pdo">PDO</a> visit the manual at <a title="PHP PDO" href="http://www.php.net/pdo">http://www.php.net/pdo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.the-arcanist.com/web-development/a-better-phpmysql-connection.html/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
