McKremie
Friday May, 22nd
Posted by Nathan

An intro to CAPTCHAs

Captcha is an acronym for Completely Automated Public Turing test to tell Computers and Humans Apart. You’ll likely recognize them as Security Images, a series of random letters or numbers, which you have to enter when sending data on most websites. This verifies that you are a human, and not a robot entering data automatically, such as a spam bot.

Captchas aren’t perfect; a spammer can still solve a captcha manually, and software may be created to solve specific captchas to varying degrees of success, but they are still essential for modern websites. They help to dramatically reduce spam and false form entries. Fortunately, it’s relatively easy to make a unique captcha with PHP and GD.

Designing a Captcha

GD is a powerful graphics library for PHP. Good hosting providers will have this library installed by default. To start off we’ll want to create an image based on a background that provides some interference for optical character reading (OCR) software, but not enough to cause difficulty for humans. The following 4 backgrounds will be used in this example:

Secondly, a unique truetype font (TTF) should be chosen. Although this tutorial will use a simple sans-serif font, feel free to look for something more interesting.

Finally, a character set must be chosen. Some prefer a combination of letter and numbers, or each individually. Either way, characters that resemble others should be avoided.

Once you have these key elements chosen, you’ll want the script to generate and display a random string which will be saved in a session. The displayed string should be altered to make it more difficult for software to recognize the characters.

Putting it Together

With your captcha planned, it’s time to put it into code. The following will begin to create your image from a random PNG background, as well as setup variables such as the font and security string:

ob_start();
session_start();

$im = ImageCreateFromPNG(mt_rand(1, 4).”.png”);

$chars = array(’a’,’b’,’c’,’d’,’e’,’f’,’g’,’h’,’i’,’j’,’k’,’m’,’n’,’p’,’q’,’r’,’t’,’u’,’v’,’w’,’x’,’y’,’z’,’2?,’3?,’4?,’6?,’7?,’8?,’9?);
$str1 = $chars[mt_rand(0, count($chars)-1)];
$str2 = $chars[mt_rand(0, count($chars)-1)];
$str3 = $chars[mt_rand(0, count($chars)-1)];
$str4 = $chars[mt_rand(0, count($chars)-1)];

$font = “font.ttf”;
$size = mt_rand(13, 16);

$_SESSION['captcha'] = $str1.$str2.$str3.$str4;

The code below is slightly more complicated, as it outputs the text at a random angle, and slightly different positions/colors. You’ll likely want to play with the output parameters.

$angle = mt_rand(-5, 5);
$color = ImageColorAllocate($im, mt_rand(0, 100), mt_rand(0, 100), mt_rand(0, 100));
$textsize = imagettfbbox($size, $angle, $font, $textstr);
$twidth = abs($textsize[2]-$textsize[0]);
$theight = abs($textsize[5]-$textsize[3]);
$x = mt_rand(5, 10);
$y = mt_rand(15,18);
ImageTTFText($im, $size, $angle, $x, $y, $color, $font, $str1);
ImageTTFText($im, $size, $angle, $x+mt_rand(20, 25), $y+mt_rand(1, 3), $color, $font, $str2);
ImageTTFText($im, $size, $angle, $x+mt_rand(45, 50), $y+mt_rand(1, 3), $color, $font, $str3);
ImageTTFText($im, $size, $angle, $x+mt_rand(65, 70), $y+mt_rand(1, 3), $color, $font, $str4);

Finally, we’ll have the following code output our finalized image.

header(”Content-Type: image/png”);
ImagePNG($im);
ob_end_flush();
imagedestroy($im);

Integrating The Final Product

The code above should output something like the following (refresh to see another):

The text in the captcha is stored in a PHP session. This can be accessed in your scripts using the global variable $_SESSION['captcha']. Be sure to call session_start(); at the start of your script first.

Further Considerations/References

To strengthen your captcha further, look into some of the many functions GD has: GD Reference. A great place to find many free fonts is UrbanFonts.com or DaFont.com

Feel free to use the code above as you see fit. It has been released as GPL v2 as part of an open source project that I worked on. The background images are also free to use, however I would recommend creating your own.

Monday May, 18th
Posted by Stuart

How many times have you used a phone book in the last couple of years? Chances are if you are like most people you simply Google what you are looking for. Phone books as we use to know them are becoming absolute. Of course the sales people from these companies will try anything to get you to sign up or keep your advertisement. The most common searches for local business are:

  • business type + city name
  • business type + zip code

Ranking number one for your keyword plus city name or zip code can increase your sales dramatically. Even ranking in the top three can help your business increase your sales. Often times you can achieve these search engine rankings for a lot less than what it would cost to have placed an advertisement in the phone book.  (which nobody uses anyway)

Where to start and what to do?

You can hire a search engine optimization company and have them achieve the results or you can follow the steps I will outline below and give it a go yourself. Hiring an experienced search engine optimization company can often save you time and money in the long run.  SEO Experts know what to look for and will generally achieve results faster. The decision to hire a firm or not should be based on your time and your level of commitment. Do not take search engine optimization for granted as an easy task that anyway can do.

Do It Yourself:

This is not a be-all end-all guide to local search engine optimization but it can help you achieve the results that your business needs.  Keep in mind that SEO is always changing and what works today might not work in the future.  If you are planning on taking on your SEO efforts yourself, then you should keep up-to-date with some online publications.  A great starting point and information about keeping up are the following websites:

Now if you are ready to take on the search engine optimization yourself you can follow the four steps below.

Step One – Understanding the Diversification of Anchor Text

Anchor text is the word or words that link to your website. The most common mistake that many people make is not diversifying their anchor text. They seem to get link after link with their main keyword in it. This is not natural and the search engines will know that you are trying to game the system.

Think of it this way, if you asked 100 people to link to your website and did not give them any instructions on what anchor text to use, how many different anchors would there be? The majority of people would not use your keywords they would simply link using your company name or website name. Others may use the URL and some will even use any words within a sentence to link to your website. Here are some great examples of diversification with anchor text.  (use Google as the example)

As you can see these are only the top five that came right off the top of my head.  If you use the same anchor text too much you may cause a negative effect on your search engine optimization efforts.

Step Two – Directory Submissions

Starting off whether it’s a new website or a website that hasn’t had any SEO before you will want to begin with getting some links to your website. A great place to start is submitting your website to around a dozen web directories. Why only a dozen and not a few hundred? Search engines look for natural growth and getting too many links too fast can have a negative effect on rankings. Plus, it’s simply not needed. We look at age and quality as the main factor of which directories we submit our websites to. Don’t get caught up on Pagerank, we focus on backlinks and a quality editorial team. Here is our list of the top six directories you should be in.

After you have submitted your website for review in these quality directories you will generally have to wait for acceptance. This can take anywhere from one to five business days. You are now ready to move on to the next phase.

Step Three – Finding Links

This is what separates the men from the boys.  (figure of speech) This is where we look for blogs or content websites within our niche. We are looking for quality websites where we can obtain links within the content of a homepage, subpage or blog post. Notice that I did not say blogroll links, footer links or any other type of links. I specifically said links within content. Same as with the directory submissions we do not look at Pagerank. We look for other quality factors like:

  1. Is the page my link goes on on-topic to my keyword?
  2. Is the page cached in Google?
  3. How many clicks away from the homepage is the page my link goes on? (one is best, two is OK)
  4. Where within the content will my link go? (the higher up on the page the better)

How to search for these links are easier than you might think. You can Goolge your keyword and search the top 100 websites looking for potential websites. Here are a few other Google searches you may want to try:

  • Keyword + How to’s
  • Keyword + State
  • Keyword + Blog
  • Keyword + City
  • Keyword + Guide

Step Four – Rinse and Repeat

Once you have obtained your links keep in mind that most links you will not see an imediate benefit.  Links are like a fine wine and are better with age.  You can often see a little increase after 1 month, 3 months and 6 months.

If you followed and completed steps 1-3 you can now start looking for more valuable links.  At this point you really don’t need to focus oin the directory submissions unless you happen to come across a high quality directory.  Stay focused on finding those in-content links that are on-topic.  Depending on how compeditive your keywords are will depend on how fast you will rank.  This process can generally take from three months to one year depending on the market.

Many web hosting companies have hidden secrets that they don’t want you to know. These secrets are marketing gimmicks and in some cases very deceptive ways to get your money. Be careful as these secrets can end up costing you lots of money.  To help prevent that we have uncovered and shown you what to look for.

7. Free Domains

WOW, a free domain sounds great doesn’t it? Guess what some web host don’t want you to know? Actually, there are a few different tactics going on:

1) The domain is free but you don’t own the domain they web hosting company owns it. Do you know what that means? Yep, you are stuck either hosting with them forever or you have to pay them what is equivalent to a ransom just to get your domain in your name.

2) The first year was free and now when you go to renew it each year they often charge $24.95+ for renewal. That’s like a 250% mark-up over what the average coast of a dot com domain name usually cost.

Now all web hosts are like this and it’s best to ask questions in the pre-sales process to find out who owns the domain name and how much do their renewal fees costs.

6. Web Hosting Review

Web Sites Web hosting review web sites are created for the sole purpose of making affiliate income. Often times the reviews in these web sites are fake and created by the owners of the review website. It is no conscience that the highest paying affiliate offers have the best reviews and somehow make it to the top positions. As an actually web hosting company we have been told by numerous review web sites that we could get to the top of their list if we pay them the high affiliate payouts.

Web hosting review web sites dominate the search engines including Google. Often times you can find that more than half the web sites in the top ten of a hosting search are not a hosting company, but a review website. Why? Well, the web hosting industry has some of the highest affiliate commission payout’s around and some of the top tier review web sites receive up to $150.00 per affiliate sign up.

5. Unlimited Storage

Unlimited Storage sounds great doesn’t it? That’s what *most* web hosting companies want you to think. The real truth of the matter is that there really isn’t a thing as Unlimited Storage. Sure, storage cost have dropped significantly in the past few years but Unlimited Storage is a marketing gimmick that many people fall for.

Here is how web hosting companies get around it. Have you ever read the complete Terms of Service of your web hosting company? If you are like most people, you browse it, but don’t completely read it all. Buried in the TOS you will find a section that mentions Server/CPU Usage. To sum most of them up it basically says if your web hosting account uses more than “X%” of the servers CPU Usage your account then violates the TOS and is subject to termination.

Now, it’s important for just about every shared web hosting company to have something like this in their TOS to protect other accounts on their servers due to improper coding and whatnot. However, many web host are using the Server/CPU Usage to get out of offering the Unlimited Storage they promise in their marketing.

4. 100% Uptime Claims

Great, you have found a web host that has a 100% Uptime Guarantee but what does that really mean? Do you actually get your money back if the web host is not up?

Uptime Guarantees are a huge marketing gimmick and the consequences for the web host are generally so minor. In order to get a full refund for a months worth of web hosting, your website would have had to of been down for a week. The truth is most customer will never notice if there website was down for a few hours and out of those that actually notice only a small fraction will ever ask for some sort of credit.

Plus keep in mind what generally isn’t included are things like; Acts of God, Server Maintenance, Wars or any other natural or unnatural events. What is an “any other natural or unnatural event”? Your guess is good as our but as we read that in many of the TOS it makes us think, any can mean anything. (blame the lawyers)

Wait that’s not all, are you ready for the kicker? The real kicker is that many of the uptime policies are only valid for Network Uptime. Network Uptime means the entire network of web servers your web hosts has. So if you happen to be on the one server that isn’t working properly the Network Uptime Guarantee probably won’t apply.

3. 24/7 Email Support

Have you dealt with web hosting companies that claim to offer 24/7 email support but often don’t reply to your initial tickets for 8+ hours? And we are talking about a human reply and not some automated message saying they will get to your ticket. There is a reason many web hosting companies don’t offer 24/7 phone and email support. They can not deliver! So instead they offer their so-called 24/7 email support.

Let’s be honest, how are you going to know if they are actually working or sleeping? You won’t and often times many of the budget or small web hosting companies won’t reply to your tickets in the middle of the night. Occasionally, some web host can only get to your support requests after the company owner gets home from his day job.

We are not saying all web hosts are like this and a good way to check is to find out where the company is located and send them a support request in the middle of the night, their time. You should be able to get a human response back within an hour or two at most. If the response take longer then you might be dealing with a one main operation that will probably come up short on your support needs.

2. Testimonials

Sure testimonials can provide great information about a web host but can you trust them? Do you really think a web hosting company would put up testimonials that were bad for them? If a web host has testimonials on their website you will only find two kids:

1) Ones they made up to make you think they are great.

2) Ones they hand picked to make them look good.

Either way is this really helpful information? No way! If you really want to find out how a web host is doing try using Google or Twitter to search for independent reviews.

1. Web Hosting Awards

Web hosting awards are very much like the Review Web Sites. Actually, most of the web hosting awards come from review web sites. Want to learn why?

Review web sites only make money when they can get traffic from PPC or Search Engines. One of the ways they get their high rankings in the search engines is because of all the links they get. By creating web hosting awards they get links from the companies they give the awards to. Many of the award images are links that point back to the hosting review website. To a web hosting review website this is an easy way to obtain links. Some are even devious to write the code where the image will not display unless the link is intact.

Monday May, 11th
Posted by Nathan

mod_rewrite is a powerful URL Rewriting Engine for the Apache web server. Although available in varying forms in other server software, this post will focus on the Apache rewriting engine.

What is URL Rewriting?

In short, mod_rewrite allows for a the server to respond in a specific way based on conditions met by the URL. This allows for many possibilities, including the creation of user friendly URL schemes for your dynamic scripts.

For example, if you have a PHP article script which requires an article id in the URL, this would typically be accomplished by:

http://example.com/news.php?id=2

However, mod_rewrite can turn that URL into the following:

http://example.com/news/2/news-article-title

The rewritten URL is much more meaningful to users and search engines. The URL is far more memorable without the php extension and id request. The article title provides search engines with more keywords, which can help with your search ranking. These benefits become even more apparent as more complicated URLs are rewritten into friendlier forms.

Getting Started

mod_rewrite is used by adding rules and conditions to a file named .htaccess in a site’s directory. The rewrite engine must first be turned on. Open or create a .htaccess file and add the following:

RewriteEngine on

A basic URL rewrite can be performed by adding a Rewrite Rule, formatted as follows:

RewriteRule pattern substitution [flags]

The pattern is a regular expression (regex), matched to the current URL. The substitution is the replacement or change made to the pattern matched URL. Flags are optional arguments which modify the way the rewrite engine acts.

To implement the rewrite example above, the following code is used:

RewriteEngine on
RewriteRule ^/news/([0-9]+)/(.+)(/)$ /news.php?id=$1 [L]

The pattern is started with ^, and ends with $. The brackets represent groups, the first matches any number of digits, the second matches any number of characters, followed by an optional trailing slash. The substitution tells the server to fetch news.php, with an id of the first group in the pattern, $1. The L flag tells the rewrite engine that this is the last rewrite to be performed.

Conditional Rewriting

To further expand control over the rewrite engine, Rewrite Conditions can be set. These allow for conditions to be matched before a Rewrite Rule is to be executed. The following syntax is used:

RewriteCond TestString CondPattern

The TestString can be one of a number of system variables, such as the current referrer or browser user agent. The CondPattern is again a regular expression, which will be matched against the TestString. A useful application to a rewrite condition is to check if files or images are being hotlinked.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.com/.*$ [NC]
RewriteRule ^\.(gif|jpg|png|bmp)$ http://example.com/donothotlink.jpg [R,L]

The conditions check if there is no referrer, or if it is from a different site. If one of those conditions are met, the rule checks if the file being accessed is an image. If so, the user is redirected (using the R flag) to an image explaining that the requested image was hotlinked.

Other Possibilities

Some common uses of mod_rewrite include; redirecting to another page based on browser user agent, moving a site to another domain, forcing the addition or removal of www. on your domain, etc.

Although mod_rewrite can be difficult to learn and master, the possibilities are endless.

Further Reading and References

Official Apache mod_rewrite Documentation
Added Bytes mod_rewrite Cheat Sheet

Thursday May, 7th
Posted by Ryan
In the past few years many companies and individuals are starting to get their feet wet in social media marketing.  It can be difficult to manage and keep up with the all the tweets, diggs, posts, updates and shouts.
To help monitor and stay connected with your social media efforts, we’ve compiled this list of 7 great tools that can help you do more with social media in less time.  Most of these tools are also a good way to stay organized and will ultimately make you a better friend to your social media buddies.

1) BackType

URL: http://www.backtype.com/

BackType is a conversational search engine that indexes and connects millions of conversations from blogs, social networks and other social media so people can find, follow and share comments.  One of the most useful features is BackType Subscriptions sends you e-mail updates whenever someone comments on a post you specify.

2) Minggl

URL: http://www.minggl.com/

Minggl is what’s called a social interaction manager and their toolbar makes it easy to manage information, communication, and navigation across (and independent of) social networks. Minggl works as a browser extension to Firefox and Internet Explorer and it adds a “relationship layer” across all your sites.  One of the best features is their Status Blaster which allows you to update your status across multiple social networks from one place.

3) Flock

URL: http://www.flock.com/

The Flock browser is designed to complement exciting social services.  It utilizes their People Sidebar, allowing you to instantly interact with your friends on Digg, AOL, Gmail, Picasa, Facebook, Flickr, Twitter, Del.icio.us, Truveo, MySpace and many others.

4) Social Mention

URL: http://www.socialmention.com/

Social Mention is a social media search engine that searches user-generated content such as blogs, comments, bookmarks, events, news, videos, and microblogging services. They also provide a feed API for developers to access search results in several different formats.

5) Social Media for Firefox

URL: https://addons.mozilla.org/en-US/firefox/addon/7888

Social Media for Firefox shows the number of Diggs, Reddit Votes, Stumble Thumbs and or Reviews, and Del.icio.us tags, Tweets, Sphinns, Mixx, and Tip’d votes so you can quickly see how popular certain content is. It can also scan said social sites to show you what content hasn’t been submitted to other social news sites so you can be the first to add it.  This can be a great tool and help you save time on Digg and Reddit.

6) TwitterFox

URL: https://addons.mozilla.org/en-US/firefox/addon/5081

This FireFox extension adds a tiny icon on the status bar that notifies you when your friends update their status. Also it has a small text input field to update your status.

7) PostRank

URL: http://www.postrank.com/

PostRank provides detailed information on Tweets, stumbles, diggs, and FriendFeed all in a convientant single place. It can help by continuously monitoring RSS feeds, finding the good stuff, and then creating a PostRank Score for each item to help filter the information to you.

Tuesday March, 17th
Posted by Ryan

We just started our 20% Off Spring Break Special.  This promotion will run for a few weeks only and can save you big bucks!Just use the coupon code below and save 20% Off your initial order of our web hosting services.

Coupon Code: SPRING

Tip: The coupon code is good off of the initial order only so save money buy paying up-front for your web hosting needs.  The coupon code will work for our prepaid 12-month and 24-month hosting plans.

*20% Off only applies to web hosting services and does not apply to domain names or other services we offer.

Friday February, 6th
Posted by Stuart

We have been on Twitter for a little while now and wanted to let our blog readers know how to find us.

@McKremie – Official Twitter Account for McKremie Web Hosting.

Twitter is an amazing social network that has been gaining huge popularity over the past few years.  I personally check and tweet a few times per day.  If you have a twitter account please send us a tweet @McKremie so I can add you to our followers list.  It’s also a great place for anyone that might have questions about McKremie to reach out to myself and the team.

We will be having a few Twitter contest from time to time so ensure you are following us to get all the details.

Wednesday December, 10th
Posted by Ryan

7) 24/7 Customer Support can be the biggest myth. Their are many companies out their that claim to offer this service but when you open a support ticket you don’t get an answer for over 6 hours. Or if they offer phone support and you try and call them in the middle of the night and the phone rings or goes to voice mail you’ve probably been had. If you are thinking about choosing a web hosting company try out their support number or emails before you sign up and see what kind of response you get and how fast.

6) Green Web Hosting are they really green? Depends on your definition of green. Many web host are now buying “green” energy from energy providers and then calling themselves green. Yes, this is a huge step but one person’s definition of green isn’t the same as others. Some host may only provide green energy to their offices and not their data centers while others the other way around. Contact the specific web host and ask them specific questions about being green.

5) Host Unlimited Domains is another marketing term that many fall for. With some web host you can indeed host numerous web sites in one account as long as you do not use more server resources than what is aloud. Check with your web hosts terms of service and see what the specific server resource limits are because these vary greatly depending on the web host.

4) Free Website Submission to the major search engines. Some web hosting companies make you think you have to pay for this or this is some sort of big secret.

http://www.google.com/addurl/
https://siteexplorer.search.yahoo.com/submit
http://search.msn.com.sg/docs/submit.aspx

3) Web Hosting Review web sites want you to think they have detailed reviews and list the top 10 web hosting companies based on actually facts. What they don’t tell you is often times the top 10 web hosting list are all generated and ordered by how much each company pays in affiliate commissions.

2) Unmetered Hosting Accounts aren’t really feasible for most. You should be extremely worried if the price for this service is under $20.00 per month. Bandwidth prices have come down in the past few years but not near enough to offer “Unmetered Hosting Accounts” for less than $20.00 per month.

1) There is no such thing as “Unlimited Web Hosting” and/or “Unlimited Bandwidth” these are just marketing terms that companies use to get people with no clue to sign up for their hosting services. Don’t fall for the biggest advertising gimmick in today’s market.

Monday December, 1st
Posted by Stuart

On November 23, 2008 at 10:00 PM PST we updated our ticket support system with new and improved software. We strive to find better ways to help our customers and our old support ticket software was OK but not great. It lacked some functions that we really need like;

1) ability to move tickets between departments
2) ability to assign tickets to a specific staff member
3) ability to suggest knowledgebase articles

There are other reasons but the above mentioned were are main criteria. We were able to close most of the open support tickets with our old system prior to the software switch. Those that had tickets opened 24 hours later on the 24th of November had new tickets created as we turned off the old system at that time. We are happy to report that the transition was smooth and the new support software is working great.

The main support URL has changed to this one here. I recommend to all our clients to bookmark this page for future reference. You can also access the support department via any page of our website in the top navigation.

Tuesday November, 25th
Posted by Ryan

Setting up a website can be a complicated undertaking, especially if you haven’t ever created your own website before.  The first thing you will need to will be to find a reliable and affordable web hosting service.  There are a lot of different web hosts out there, how do you choose which one is right for you?

If this is your very first website, you should look for a web hosting service that also sells domain names.  This way you won’t have to worry about the technical procedures of making sure that typing in your domain name actually sends people to your site.  The web host will take care of it for you!

For most beginners, shared web hosting is the best option.  This means that your website will be hosted on a single server with many other websites, but you will still have total control over the look, feel and content of your site. Shared hosting is cheaper and will allow you to build an audience for your website while you learn how to do all of the coding and technical stuff behind the scenes.

You will also want to look for a web host that comes with Fantastico.  Fantastico is an excellent application that installs a variety of website materials into your databases for you.  With Fantastico you can easily install website software with just the click of a button!

Having good customer support is a must-have for those who are in the “infant” stages of setting up web hosting.  Look for a service that has a phone number that you can call for support 24/7.  The last thing you want to do is wait for e-mails from tech support to help you figure out how to fix your website!

Web hosting is something that is best learned “on the go.”  As you work with it, you will learn which options you really need and which things you can do without.  Most website owners learn by doing, so don’t panic if you still feel a little bit like you’re feeling around in the dark, trying to learn the layout of the land!