Say yes to Blogging

So, Ive blogged now for a little over a week. Ok, so Ive blogged in the past on other topics, but not as consitently or comprehensively; at least in the sense of making posts longer than 20 or 30 words and posting everyday writing unique and semi compelling stuff!

Why am I so surprised that I’m actually enjoying writing about things I find interesting, amusing and entertaining? I haven’t got any huge audience or anything like that, and to be frank I’m not too bothered. I’m just enjoying the process. Its cathartic even, its good to talk.

As Ive said previously. I have blogged before. Some of the stuff I blogged on was kinda personal. I blogged about my divorce for example, it was an excellent vehicle that helped deal with a shitty time in my life. Ive blogged about my everyday life – its ups and its downs, mostly just sporadic moans and rants.

Continue reading »

Search Marketing Services Holistic Search
 

Web Pro News have put together some really good videos together over at their site.

This link here entitled the do’s and dont’s of Digg is a great discussion on doing well in Digg as well as things to avoid. Its also a good general discussion around social media, tips for choosing an SEO, PPC and arbitrage, the future of search, trends in the industry and a few other related topics.

If you are interested in search and blogging and site monetisation and social media and all the other stuff that makes up this thing called the internet such an interesting space to play in, then go check them out, they are definitely worth a look!

Good stuff, well done Mike,Neil and Todd . :)

Warning: Make sure you have some time on your hand as I spent like um…2 hours watching all sorts of interesting stuff over there!

 

In part 1 of how to build a database driven website we looked at creating the database and tables and looked at some simple options for inserting data. In this part we are going to look at connecting to the DB using PHP, creating a simple template as well as discussing a few site architecture issues.

In this part we are going to look at connecting to the DB using PHP, creating
a simple template as well as touching on a few site architecture issues along
the way.

We are going to use a simple PHP connection script to connect to your DB, which
will be saved in a separate file and stored outside of root.The connection script
will contain the username and password for connecting to our database.

It looks like this.

<?

@ $db = mysql_connect(“localhost”, “username”, “password”);

//this line specifies the user and password for the database we intend to access

if (!$db) //if we are unable to connect to the database we tell people {

echo “Error: Could not connect to database. Please try again later”;
}

mysql_select_db(“hotels”);

?>

We save the above code in a file and call it conn.php. We can then use a PHP
include or a require at the top of pages that access the database like so.

<?

require “../conn.php”;

$country=”England”; //set the country for the database

?>

More on connecting to the database further on, for now, lets briefly look at
a typical page and how we intend to output our content and urls.

Page structure and URL formats

Our database will be used to determine our url naming conventions. We will use
the place names and hotel names and hotel id’s to form our linking and navigational
structure.Our database contains a series of places from across a region. For
brevity sake lets assume that our site is specific to England.

England is made up of around 39 specific counties. These counties contain a
number of towns and cities. Our plan is to output hotels specific to each county
and town within.We would aim for a clean url structure so that each section
of our site has a url that is logical to the area it represents, is easy to
read and book mark.

Even though our site is dynamic, we can use a handy little feature of the apache
webserver model to change our urls from ugly difficult to read concepts like.

/filename.php?county=hertfordshire&town=hitchin

By using something called an .htaccess file we can rewrite urls so that the
above can be made to look like this

/hertfordshire-hotels-hitchin.html

The .htaccess entry that enables this might look something like this.

RewriteEngine on

RewriteBase /

RewriteRule (.*)-hotels-(.*)\.html$ /filename.php?county=$1&town=$2 [L]

It uses an apache module called mod_rewrite.

This is very handy indeedy as it allows us to have the clean uniform url file
structure we are seeking to use, enabling naming structures throughout thus.

$county-hotels-$town.html becomes hertfordshire-hotels-hitchin.html

* We can add additional lines for additional pages and files specific to whatwe want to achieve. A link to al the site files will be supplied at the end of the series.

A database query for say, hotels in hertfordshire would then use the $county
variable (referenced as $1 in the .htaccess file above), and return a list of
towns or hotels for that particular area.

Page Template and contents

hotengsml1.gif

Our sample page is going to be very simple. It consists of a logo at the top,
with a main body content area.

*Ive omitted <head> content for now. The information that follows concentrates on the content that will appear between the <body></body> tags. Full html code will be supplied at the end of the series.

Header Logo

Our header ‘logo’ is a styled header or Hn tag which uses a background image to sit
behind the text and gives it the appearance of being an image..

The <style> is contained in the <head> of the document and looks
like this.

<style>

H1 { font-size: 12pt; height: 24px; width: 100%; letter-spacing:
4px; vertical-align: bottom; color: #000066; font-weight: 35; background:0 url(/header.jpg)
no-repeat; float: left}

</style>

<h1>Hotels and Accommodation in <?=ucfirst($town);?></h1>

Area related images

The images are sourced via a flickr plug in using the tag aspect of the flickr
url to order area specific images.

<script type=”text/javascript” xsrc=”fullflickurl&tag=<?=$town;?>” mce_src=”fullflickurl&tag=<?=$town;?>” ></script>

flickr.gif

Contextual adverts

We may as well accrue some residual income. Not everyone will like the hotels
outputted, so if they click on our ads and find what they want its all good,
we win, they win.

<h2><?=$town;?> Travel Ads </h2>

<script type=”text/javascript” >Contextual
ad code </script>

ads.gif

Outputted Hotel

We are outputting our hotel to give a brief outline of its key points . We will
include high level information such as name, price, star ratings, booking url,
full detail url as well as a teaser of its full description.

We achieve this using the following code.

First our query
<?

$query = “select * from hotelcontent1, hotelcontent2

where hotelcontent1.custid = hotelcontent2.custid and town

= ‘$town’ and county =’$county’ and country = ‘$country’ order by custid limit 0, 1 ” ;

$result = mysql_query($query);

?>

Then we want to do some manipulation on the description element of the returned content.

<?

$row=mysql_fetch_array($result);

$desc = stripslashes($row['description']);

$content = $desc;

$text_length =300;

$add=strlen($row[town]);

$text_length=($text_length + $add);

$stricon=($content);

$all_content=strlen(“$stricon”);

$standard_content=substr($stricon ,$text_length);

$compare=stristr($standard_content ,” “);

$minus_content=strlen(“$compare”);

$result_content=$all_content-$minus_content;

$display_content=substr($stricon ,0, $result_content);

$stripped_content=stripslashes($display_content);

$stripped_content=nl2br($stripped_content);

$description=$stripped_content;

?>

Before finally putting it all together and outputting our hotel.

<h2><?=ucfirst($town);?> Hotel of the Month </h2>

<?

echo”<div class=message><h2>$row[ename]</h2><i class=p2>
$row[country] > $row[region] > $row[county]> $row[town] </i><br><table
width=\”95%\” CLASS=\”hoteltables\”><thead> <tr><td
bgcolor=\”#999999\”> <b><font color=\”#FFFF33\”>Hotel
in $row[PostalTown] </font></b></td> </tr></thead>
<tr><td> <p class=p2><img xsrc=\” /$row[photourl]\”
height=\”68\” width=\”90\” alt=\”$county hotels:$row[ename]\”
align=left id=thephoto> <strong> $row[ename] </strong> – $description
…<br> <a xhref=\”/book.php?id=$row[hotelid]\”>Book</a>
<a xhref=\” /more.php?id=$row[hotelid]\”>More</a>
</font></p></td></tr></table> <br></div>”;

?>

hotel.gif

Navigational links

Links are an important aspect of the sites architecture they are used by humans
and bots to give anchored clues to the content of their target pages. Search
engine bots use these anchors or its better known phrase of anchor text to help
weight documents in their search engine databases.

To output our links we used the following sql.

<?

$query = “select Distinct county from hotelcontent2 where country = ‘$country’ ORDER BY county” ;

$result = mysql_query($query);

?>

The query here is very simple, it says give me a set of distinct counties from
the database table named hotelcontent1 where the counties returned are a subset of England. These are then outputted via a loop producing a series of links for our navigation footer.

The for loop for which makes this possible, might look a little like this.

<h3>Regions of <?=$country;?></h3>
<p>

<?

$num_results=mysql_num_rows($result); //number of rows

for ($i=0; $i <$num_results; $i++) {

$row = mysql_fetch_array($result);

$countyname=strtolower($row[county]); //ensure the county name is lower case

echo “<a xhref=\”/$countyname-hotels.html\”>$row[county]
hotels </a> “;

}

?>

</p>

The above loop outputs something like this in our footer
navlinks.gif

We could also produce other links relative to the county we are in. We are in a page that is a subset of Hertfordshire (Hitchin) . Contextually, it makes sense for our users to see what other towns are in Hertfordshire. It also helps our other pages to get indexed by search engines and has the added bonus of making our pages that little bit different for others within in our site.

Lets output the towns relative to our $county and $town variables referenced from the url for our page about Hitchin hotels in Hertfordshire.

<?

$query = “select Distinct town from hotelcontent2 where county = ‘$county’ and country =’$country’ AND town != ‘NULL’ ORDER BY town Limit 0, 20? ;

$result = mysql_query($query);

?>

The query here is very simple, it says give me a set of distinct towns from
the database table named hotelcontent1 where the town is a subset of a variable
named $county (hertfordshire in this instance) .Which when looped and
outputted produces a maximum of 20 urls, or links for our nav footer.

The for loop for which makes this possible, as in the one outlined aboved might look a little like this.

<h4>Towns within <?=ucfirst($county);?></h4>
<p>

<?

$num_results=mysql_num_rows($result); //number of rows

for ($i=0; $i <$num_results; $i++) {

$row = mysql_fetch_array($result);

$townname=strtolower($row[town]); //ensure the town name is lower case

echo “<a xhref=\”/$county-hotels-$townname.html\”>$row[town]
hotels </a> “;

}

?>

</p>

In the next part we will look at building an individual hotel detail page and look at some of the structural elements that will, given a multitude of other factors, help our pages perform relatively well for our target keywords within the search engines.

 

Continue reading »

 

Easy come easy go… 

It’s no news to say that the days of easy rankings with easy commissions are long gone. With some search engines, it just no longer works. Anyone, and lots are, can whack up a DB or add a feed from some central source. It’s child play, and from a search engine viewpoint its just not welcome. They’d be happy to kick yo ass as soon as look at ya, and who could reasonably blame them? You can have the most well linked, beautifully constructed site in the world full of some mythical kw density perfection, css’ed to the nth with elements positioned to the max, but if you aren’t saying anything new, then the chances are that things could get pretty serious pretty quickly. Search engine death could well become you. Sure, you’ll get spidered, but expect to go supplemental pretty quickly, and if that don’t happen then you might get extra lucky and get lumbered with a nice fat -31 ranking penalty.

Fat or thin?

Over the years, there’s been quite a bit of discussion on what constitutes a thin or a fat affiliate. Lets look at travel. Fat boys like tripadvisor for example, are flying with lots of top spots on a range of travel related kw’s whereas others are floundering.

I recall a time when for like, 4 or 5 years a particular little travel network absolutely kicked arse on all of the big 3, Google, Msn and Yahoo. Be it ‘hotel in town‘ or  ’town hotels’ these guys had top spots usually in the top 5 positions. They were nothing other than a well constructed, well linked network of affiliate feeds that did little other than pump out content that their suppliers provided. It really was an education to look at what these people had done. Their strategy was for the time, basically fab. They hosted a variety of big sites across a variety of IP’s. They mixed pages up with a mishmash of approaches doing things like varying page element factors, curtailing product description content, differing kw and kp densities, different navigational placement, text types, god you name it they’d factored it in one way or another, and it paid them big dividends. I guess really it was a day when it was all about getting as many pages into the search engine db’s as you possibly could. Their duplicate content filters were so underdeveloped that provided you did enough variation in the places that mattered, ie page naming, title tags, H tags general kw peppering here and there in your content spread etc, then you’d be pretty ok. In fact you got massively rewarded and could do some great stuff with inward link creation too. You didn’t have to worry about going out and sourcing zillions of links from here there and everywhere, you’d just create your own and ensure that they were appropriately placed and hidden across a network of unidentifiables, albeit in the sense of what the spider saw and registered at least!

A different breed of engine

Today of course, these guys are nowhere to be seen, at least not in any recognisable guise. Their network was nuked and they don’t rank for jack no more. Things like the Google eval team have given people using that particular strategy a short sharp shock.

New generation networks, if they hope to have sustainable long term SERP viability have to be a whole lot smarter in 007. Content feeds and databases, particularly with regard to outputting their contents within a site needs special attention – noindex tags, robot exclusion protocols really are serious considerations, to not do so could really be a huge folly. Drastic?,Perhaps so, but what with duplication filters and all, the question is one of almost can you afford not to?

Sure, there will always be those who look to employ methods for circumvention, all that lovely content is just too good to pass up on after all, right? Not sure about you, but I’ve seen all manner of interesting adaptations; things like replacing keywords and phrases programmatically so that an aspect of a phrase like um…this hotel is decorated to a fine standard  is changed to read… this fine placename hotel is adorned to a splendid configuration instead, or variations upon that theme. I’ve seen sites that rank well by using contractions of product descriptions, eg chopping the first 40 characters from the phrase and outputting the remainding 180 chars. Ive seen others that just hide them all together, via a document.write or iframe method. Some go as far as employing people to write phantom reviews, and some even write programs that write reviews on the fly! It really is incredible to see the ingenuity and nous that people have with this stuff, it really is the most elegant of elegant of spamination. I think its fair to say that people do this because they realise that things may well be tenuous, they know that unless you are whitelisted then you need to tread very carefully as your income stream is very precarious.

As simple as adding value then…

Perhaps its simple though, isn’t it all about  thinking  in terms of adding value, going above and beyond what your competitors are doing, seriously asking yourself will you be able to pass some random manual inspection, which lets face it, if you are ranking in a competitive earning space, you are likely to receive sooner or later. You’d be an idiot for thinking that just because you managed to outwit the bot via some clever use of string functions, or tag placement or link generation that a human wouldn’t pick up and notice something amiss.It isn’t unreasonable to assume they’d ask whether your site handles all the look up processes - Does it check for availability – Are the payments handled insite, or do they go off elsewhere?-  They’d see through a hidden frame or  include or some obfuscated url redirect,  you just will not be able to get away with what you once did, and if you think you will then, i wish i could share your complacency, as any serious examination of what you do would look at exactly some of these things.

On the positive, some of the better providers and networks do offer more advanced solutions of course, this helps insulate both them and their partners and is basic good business sense, but lots don’t too and for those who are getting hit via various penalties resulting, its a bit of a shame at best and a damn tragic waste at worst.

Should these guys be helping their income generators in this way?

If you are a search rep then you’d prolly say no, it sucks and doesn’t help in the goal of delivering varied unique content, but OTOH why would any big supplier expose themselves to the vagueries of singular url streams of income that could be cut off at the whim of a policy shift. I know what I’d say of course, I go with the majority scatter and seed approach. Watch the darwinian process evolve and reward my best performers. I’d also help nurture and protect  newcomers too, my future top performers. Give them tools to get their users interacting, enable the creation of communities,  feedback tools, make it all that little bit different, employ advisors to help steer and encourage and generally add value all round, but I guess i’m me, and not some multi layered corp that moves real slow.

I’ve used travel as its any easy example to flesh out and one that I’m at least familiar with. I do wonder whether other sectors face similar challenges; I expect they do no doubt to both lesser and greater extents, especially in some of the mass product markets. It would be great to read some inputs, feel free to call me out!

© 2012 Rob Watts - SEO - SEM - Social Media Suffusion theme by Sayontan Sinha