Featured Post

About this Site

Popular Posts

Alex King's Popularity Contest plugin would work really well here.

Most Discussed Posts

Nick Momrik's Most Commented plugin would work really well here.

Protecting a download link using a unique URL

A client asked me to develop a simple method for protecting a download (or digital product) by generating a unique URL that can be distributed to authorized users via email. The URL would contain a key that would be valid for a certain amount of time and number of downloads. The key will become invalid once the first of those conditions is exceeded. The idea is that distributing the unique URL will limit unauthorized downloads resulting from the sharing of legitimate download links.

In addition, once the key has been validated, the download starts immediately, preventing the visitor from seeing the actual location of the download file. What’s more, the filename of the download in the “Save as” dialogue box isn’t necessarily the same as the filename of the file on the server, making the file itself pretty much undiscoverable.

How it works

There are five main components to this system:

  1. the MySQL database that holds each key, the key creation time, and the number of times the key has been used
  2. the downloadkey.php page that generates the unique keys and corresponding URLs
  3. the download.php page that accepts the key, verifies its validity, and either initiates the download or rejects the key as invalid
  4. a dbconnect.php file that contains the link to the database and which is included into both of the other PHP files
  5. the download .zip file that is to be protected

Place all three PHP scripts and the .zip file into the same directory on your server.

The MySQL database

Using whatever method you’re comfortable with, create a new MySQL database named “download” and add the following table:

CREATE TABLE `downloadkey` (
`uniqueid` varchar(255) NOT NULL default '',
`timestamp` varchar(255) NOT NULL default '',
`downloads` varchar(255) NOT NULL default '0',
PRIMARY KEY (uniqueid)

The downloadkey.php page

This page generates the key, creates a URL containing the key, and writes the key to the database. Never give out the location of this page – this is for only you to access.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<title>Download Key Generator</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="author" content="http://www.ardamis.com/" />
<style type="text/css">
#wrapper {
font: 15px Verdana, Arial, Helvetica, sans-serif;
margin: 40px 100px 0 100px;
.box {
border: 1px solid #e5e5e5;
padding: 6px;
background: #f5f5f5;

<div id="wrapper">

<h2>Download Key Generator</h2>

// A script to generate unique download keys for the purpose of protecting downloadable goods

require ('dbconnect.php');

if(empty($_SERVER['REQUEST_URI'])) {

// Strip off query string so dirname() doesn't get confused
$url = preg_replace('/?.*$/', '', $_SERVER['REQUEST_URI']);
$folderpath = 'http://'.$_SERVER['HTTP_HOST'].'/'.ltrim(dirname($url), '/').'/';

// Generate the unique download key
$key = uniqid(md5(rand()));
//  echo "key: " . $key . "<br />";

// Get the activation time
$time = date('U');
//  echo "time: " . $time . "<br />";

// Generate the link
echo "<p>Here's a new download link:</p>";
echo "<p><span>" . $folderpath . "download.php?id=" . $key . "</span></p>";

// Write the key and activation time to the database as a new row
$registerid = mysql_query("INSERT INTO downloadkey (uniqueid,timestamp) VALUES("$key","$time")") or die(mysql_error());

<p>Each time you refresh this page, a unique download key is generated and saved to a database.  Copy and paste the download link into an email to allow the recipient access to the download.</p>
<p>This key will be valid for a certain amount of time and number of downloads, which can be set in the download.php script.  The key will expire and no longer be usable when the first of these conditions is exceeded.</p>
<p>The download page has been written to force the browser to begin the download immediately.  This will  prevent the recipient of the email from discovering the location of the actual download file.</p>


The download.php page

The URL generated by downloadkey.php points to this page. It contains the key validation script and then forces the browser to begin the download if it finds the key is valid.

// Set the maximum number of downloads (actually, the number of page loads)
$maxdownloads = "2";
// Set the key's viable duration in seconds (86400 seconds = 24 hours)
$maxtime = "86400";

require ('dbconnect.php');

if(get_magic_quotes_gpc()) {
$id = stripslashes($_GET['id']);
$id = $_GET['id'];

// Get the key, timestamp, and number of downloads from the database
$query = sprintf("SELECT * FROM downloadkey WHERE uniqueid= '%s'",
mysql_real_escape_string($id, $link));
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result);
if (!$row) {
echo "The download key you are using is invalid.";
$timecheck = date('U') - $row['timestamp'];

if ($timecheck >= $maxtime) {
echo "This key has expired (exceeded time allotted).<br />";
$downloads = $row['downloads'];
$downloads += 1;
if ($downloads > $maxdownloads) {
echo "This key has expired (exceeded allowed downloads).<br />";
$sql = sprintf("UPDATE downloadkey SET downloads = '".$downloads."' WHERE uniqueid= '%s'",
mysql_real_escape_string($id, $link));
$incrementdownloads = mysql_query($sql) or die(mysql_error());

// Debug        echo "Key validated.";

// Force the browser to start the download automatically

$file = real name of actual download file on the server
$filename = new name of local download file - this is what the visitor's file will actually be called when he/she saves it

$file = "actual_download.zip";
$filename = "bogus_download_name.zip";

header("Cache-Control: public, must-revalidate");
header("Pragma: no-cache");
header("Content-Type: " . $mm_type);
header("Content-Length: " .(string)(filesize($file)) );
header('Content-Disposition: attachment; filename="'.$filename.'"');
header("Content-Transfer-Encoding: binaryn");



The dbconnect.php script (database connection)

This is the PHP include referenced by both scripts that contains the database link.

// Connect to database "download" using: dbname , username , password
$link = mysql_connect('localhost', 'root', '') or die("Could not connect: " . mysql_error());
mysql_select_db("download") or die(mysql_error());

This file will almost certainly require some editing. You will need to specify a host name for your MySQL server and a MySQL username and password in that file at mysql_connect('localhost', 'root', '') so that you can connect to the database you’ve set up. It’s extremely unlikely that your production MySQL database will be installed on localhost with a user “root” and no password.

That’s all there is to it. Whenever you want to give someone access to the download, visit the downloadkey.php page. It will generate a unique key code, save it to a database, and print out a URL that you can copy and paste into an email or whatever. The page at that URL checks to see if the key code is legit, then checks to see if the code is less than X hours old, then checks to see if it has been used less than X times. The visitor will get a descriptive message for the first unmet condition and the script will terminate. If all three conditions are met, the download starts automatically.


Top 5 Tools for Analyzing Your Backlink Profile – A SPN Exclusive

Link-Building is difficult at the best of times, but Google has made it even harder for us as SEO’ers to build quality, high authority links after the infamous Penguin and Panda updates (I call this Penganda!). Many low quality link sources were completely obliterated by Google during Penguin resulting in lost link value for a lot of sites engaging in low quality directory submissions and blog network linking.

I have seen a lot of comments recently of people complaining that their sites have suddenly dropped and competitors starting to outrank them on their main terms. Panic seems to have set in a lot of people when they see these shifts after a notorious Google algorithm update. My advice would be to not panic, but delve into the data and discover exactly why these changes have occurred and develop a strategy to remedy the solution based on hard data. The first place to start looking is your overall link profile, and that’s what I’m here to discuss.

For seasoned SEO’ers analyzing link profiles comes naturally, although for the less experienced or those not in the know it can be a daunting to determine where to start and how to go about it. There are some great tools out there, some free, some not, but nonetheless all specifically designed to give you insightful data about your website’s backlink data.

In order of preference, my personal top five tools for analyzing backlink profiles are:

1. Google
Google?! I hear you say? Yes Google! Google should be the first place you start to analyze your link profile. Why? Well first it’s free, and secondly it’s Google that takes notice of your link profile and ranks you so the data they give you probably has some significance!

Google doesn’t offer some fancy dashboard or enable you to download massive excel sheets, but it does give you a quick and dirty picture of what sites are linking to your site. Simply go to Google and type link:”www.mydomain.com” -site:www.mydomain.com into the search box. This will give a quick set of results of sites linking to your site. This data is not infallible. I rarely find it showing every link – but I do find some of the results interesting that other tools don’t pick up. It’s a good start, it’s free and it’s easy. What more do you want?

Google also gives us numerous other free tools to help us analyze our link profiles. Google Webmaster Tools is one of them. Again, not always 100% accurate in it’s data, but it is a good indication of the links that Google can “see” and values. You need to have your website set up in Google Webmaster Tools first before you can start seeing link data.

2. MajesticSEO
MajesticSEO is by far my favorite go-to tool for link building data. The data it provides is by far – in my opinion – the most advanced from any tool currently on the market. Majestic offers both free and paid versions of the tool. If you are simply trying to analyze your own website’s link data, then a free account will suffice, otherwise, if you’re an agency or deal with multiple clients, you will probably require a paid subscription, although I guarantee it is completely worth the minimal monthly fee for the data it provides!

So what is so good about Majestic? Well simply enter your domain into Majestic and out comes a wealth of data regarding links pointing at your site. They have also implemented a trust/citation flow metric which in layman’s terms simply tells you how well that link coming to your website is trusted and whether it is passing useful keyword anchor text relevance back to your site.

The vast amount of reports and data you can retrieve from Majestic can seem overwhelming, although there are ways to quickly visualize this data for maximum impact which I am going to soon discuss in another article on my blog.

3. Open Site Explorer
It was hard to choose between Majestic and Open Site Explorer and I would have probably listed OSE as number two if it provided cool trust/citation flow graphs. However OSE is an industry standard link explorer tool from the awesome guys at SEOMoz. The tool offers a free limited account, although this only lets you see the first five results. I would highly recommend getting a paid account at SEOMoz. The data that OSE provides can be invaluable not only at finding links pointing at your site, but also links pointing at your competitors, allowing you to compare your own site against theirs.

I also believe that OSE has the best metric system – mozRank and mozTrust are two widely accepted industry measurements that can quickly show how you compare to other sites.

4. Ahrefs
Ahrefs is another tool similar to Majestic. It has some features that are pretty cool and which the other tools do not. One of the best and most notable features of this tool is it’s “lost link” feature. This data allows you to view what links have been recently lost to your site and also new links. Ahrefs is probably the best tool for finding problems in your link profile, especially if you have suddenly lost a large number of links, although it is again a paid tool.

5. Blekko
Relatively unknown, Blekko is a brilliant little free search engine with multiple uses. A simple search engine that allows you to use paramaters at the end of searches. Go to Blekko.com and try searching for www.mydomain.com/seo. This handy little tool gives you a nice, quick visualization of your inbound links as well as some other useful statistics such as the neighborhood on shared hosts or the latency of your site.

Well these are the tools I generally use on a day-to-day basis for analyzing link profiles of sites. Anyone with a bit of time and a little knowledge of how links work can have a shot at these tools and find some insightful information about the kind of sites linking to them and the quality of those sites. What you can do with all this information is a topic for another day!

How to Increase Your Ranking to All Search Eagine

Today I would like to talk about an easy way to get high traffic links to your site for free. This method is really simple and only requires a little of your time to see results. I have personally used this method to generate 260+ links and 392+ unique visits to my site in under a month. It also produced top ten rankings in Google, yahoo and AltaVista without even submitting my site to them! Sound exciting? Let’s get started.

What you will need:

You will need the Google traffic ebook to find the page rank of any given page. You can download it for free from HERE.

Once you have the toolbar installed, you are now ready to start your quest for high powered links. Think of your target market and go to http://www.google.com. If you own a site about dog training, do a search on dog training and look at the results that come up. Now, click on the sites that are relevant to what your site is about. Look at the Google toolbar at the top of your web browser; do you see the page rank display? If not, click on options and put a checkmark in display Google page rank. This will allow you to see the rank of the current page simply put your mouse cursor over the green bar under page rank in your toolbar.

Look at the number that is displayed, this will be anywhere from 0-10 the higher the number, the more traffic that site is getting. Ok, so you found a site with a good page rank, 4 or higher is, in my opinion, a good ranking. Now, look at the links on the page, do you see anything on the page that says links, resources, directory or anything similar? If so, this is where you can add your website link and description of your page. Some webmasters will ask you to put a link on your website in return for the one they place on their site. This is very easy to do. Simply create a page on your site called links, or resources, or whatever you think would be relevant to your site.

Most website owners will have specific instructions on what they would like you to place on your site. just follow these and it will work out fine. You will want to make the description of your site as attractive as possible to entice people to click on your link. If the site receives a lot of traffic, it is likely a lot of people will click on your link and check out your page. There you have it, FREE traffic.

Do this every day, and if you get only one link a day that’s 30 links a month pointing to your site! This will produce good targeted traffic and get you listed in the search engines quickly and it won’t cost you a dime.

Top 20 Contributing Factors for Google SEO

Websites are quickly becoming one of the most popular ways of advertising. Whether it be a business, its product or service or something completely different, everyone of all ages are turning to the web as a method of getting their message out there. With the popularity of this marketing medium increasing and the number of websites always growing, it is obvious that everyone wants to appear at the top of Google’s search engine rankings. Achieving such a task is never an easy feat, however with a bit of perseverance, one can definitely increase their chances of reaching that glorious first page result.

Given that there are a heap of websites out there who are on the first page, what is their secret? It is a little industry term called “SEO” and it stands for Search Engine Optimisation. SEO basically consists of the customisation of your website, its content and its internal and external links to assist in the overall indexing and ranking of your website in popular search engines. There are many contributing factors that are used in determining a website’s ranking and every search engine is different. This makes trying to optimise your site for Google, Yahoo, Live and the many others quite a pain staking task.

As most of us are aware, Google is currently the most popular search engine for the majority of Internet users. As such, it is only normal that we’d want to focus our sights on achieving a higher ranking within Google first with a hope that the rest will follow. To do this, we must start a journey that could potentially take months before we start seeing any real change, however we have to start somewhere.

Our journey begins by defining some of the key contributing factors that Google uses to determine a website and webpage’s ranking within its results. These factors range from keyword use to manipulating internal and external links and the list goes on. To get you started, we have listed the top twenty factors that you should focus on in order to help get your website that little bit closer to the top of the search engine results listing.

Keyword Use Factors
The following components relate to the use of the user’s search query terms in determining the rank of a particular page.

1. Keyword Use in Title Tag – Placing the targeted search term or phrase in the title tag of the web page’s HTML header.
2. Keyword Use in Body Text – Using the targeted search term in the visible, HTML text of the page.
3. Relationship of Body Text Content to Keywords – Topical relevance of text on the page compared to targeted keywords.
4. Keyword Use in H1 Tag – Creating an H1 tag with the targeted search term/phrase
5. Keyword Use in Domain Name & Page URL – Including the targeted term/phrase in the registered domain name, i.e. keyword.com plus target terms in the webpage URL, i.e. seomoz.org/keyword-phrase.

Page Attributes
The following elements comprise how the Google interprets specific data about a webpage independent of keywords.

1. Link Popularity within the Site’s Internal Link Structure – Refers to the number and importance of internal links pointing to the target page.
2. Quality/Relevance of Links to External Sites/Pages – Do links on the page point to high quality, topically-related pages?
3. Age of Document – Older pages may be perceived as more authoritative while newer pages may be more temporally relevant.
4. Amount of Indexable Text Content – Refers to the literal quantity of visible HTML text on a page.
5. Quality of the Document Content (as measured algorithmically) – Assuming search engines can use text, visual or other analysis methods to determine the validity and value of content, this metric would provide some level of rating.

Site/Domain Attributes
The factors below contribute to Google’s rankings based on the site/domain on which a page resides.

1. Global Link Popularity of Site – The overall link weight/authority as measured by links from any and all sites across the web (both link quality and quantity).
2. Age of Site – Not the date of original registration of the domain, but rather the launch of indexable content seen by the search engines (note that this can change if a domain switches ownership).
3. Topical Relevance of Inbound Links to Site – The subject-specific relationship between the sites/pages linking to the target page and the target keyword.
4. Link Popularity of Site in Topical Community – The link weight/authority of the target website amongst its topical peers in the online world.
5. Rate of New Inbound Links to Site – The frequency and timing of external sites linking in to the given domain.

Inbound Link Attribute
These pieces affect Google’s weighting of links from external websites pointing to a page and ultimately will assist in the ranking of that page.

1. Anchor Text of Inbound Link.
2. Global Link Popularity of Linking Site.
3. Topical Relationship of Linking Page.

4. Link Popularity of Site in Topical Community – The link weight/authority of the target website amongst its topical peers in the online world.
5. Age of Link.

Negative Crawling/Ranking Attributes
There are also some points we should make before you start getting your hands dirty. With any type of SEO marketing, there are some things that can actually have a negative impact on your ranking. These following components may negatively affect a spider’s ability to crawl a page or its rankings at Google.

* Server is Often Inaccessible to Bots
* Content Very Similar or Duplicate of Existing Content in the Index
* External Links to Low Quality/Spam Sites
* Duplicate Title/Meta Tags on Many Pages
* Overuse of Targeted Keywords (Stuffing/Spamming)

It’s now time to get busy! Start prioritising your tasks, modifying your content and building your internal and external links to meet some of the above guidelines. Keep in mind that improving indexing is mostly a technical task, improving ranking is mostly a business/marketing strategy, what might work now may not work in the future and finally, it takes time. Loads of time. Still, with a bit of trial and error and a good dose of persistence, you can achieve the search engine ranking you’re after.

Add Links With Forum Posting

The difference between search engine optimization(seo) and search engine marketing(sem) is money. Optimization is the art of getting ranked high in the organic(free) listings of a major search engine for the keywords for want. This provides free very targeted traffic to your website. Search engine marketing is paying not placements in a major search engine.

Search engine optimization can be broken down into 2 pieces building quality content for the keywords you are targeting and getting quality, related websites to link to that content. This article is focused on getting quality, related websites to link to your website. After all, you can have all of the quality content on a subject you want, but if no one links to it it will not rank well in a search engine. Getting ranked high for certain keywords in your industry, will bring you continual targeted traffic. This is a vital part of an overall marketing approach for any internet business. This effects the bottom line directly because it reduces the spending you need to do to get traffic.

Posting in forums is arguably the best way to pay for your hosting (you post, host gets money form forums ads), just make sure that you don’t need to post everyday only to maintain your account. Subsidy from paid accounts might be cool, but you need to be aware of constant attempt for conversion from free to paid account.

Posting in forums isn’t only helpful in generating traffic through links, it’s a two way street, whereby you get to meet and hopefully help readers resolve their unresolved issues. If you cannot resolve the issue first hand, you can steer them in the right direction by sharing links to sites that have helped you in the past.

Joining online communities and posting in forums is a great way for you to start networking and talking about your business without the pressure of in-person networking. Forums give you the chance to prove yourself as a knowledgeable person in your field, and as a respected member of the community. Additionally, the high traffic nature of forums make them natural candidates for frequent Googlebot visits, which boosts the PageRank of your site as well as provides some indirect marketing for you.

Now let’s talk about online discussion forums. Not only is the traffic targeted, but if you take the time to analyze your site statistics, you will find that this type of traffic will spend longer on your webpages than other types of traffic.

A name that goes unmatched when it comes to service, depth of knowledge and of course help. You will often notice for yourself that the best forums are really those where the members are passionate about the subject the forum deals with, are successful themselves or at least very enthusiastic about what they do and there is this inherent energy about seeing everyone out there reach the pinnacle of success.

Another way is to provide higher search engine rankings and higher adsense revenue is by forum posting. This technique is most profitable for ranking high in Google. It is a good idea to link many other sites that are related to your subject as you can. You will find that some websites have achieved their top rankings with the help of links from forums and messageboards. So the idea is to find some high quality forums or message boards related to your industry and try to keep posting there. So whenever you post in forums you can post your links in the signature which can help your website to top rank in the search engines.

  • Calendar

    February 2017
    M T W T F S S
    « Jul    
  • Categories

  • Archives

  • Join My Community

  • Miscellaneous