Archive for Code

Inline Editing with Ajax

Last week I came across a tutorial and code for inline editing using Ajax.  The reason I was looking for this sort of application was to implement a project management solution for one of my clients.

What inline editing does is allow you to edit an online document on the fly using AJAX, PHP and MYSQL.  An example of this nifty solution found here: http://www.yvoschaap.com/instantedit/

Any of the fields can be edited and the editing is reflected right away in the MYSQL database.

If you have any questions about how to implement this please post here.

A special thanks to Yvo Schaap for supplying us with the code and example!

Comments

Meta Tags for E-tail Sites

I recently conducted a competitive analysis for one of my etail clients and to my astomishment, I found that out of the 13 competitors I tracked, none utilised the meta description tag on their site.  This prompted me to write a post on this discussing meta tags and best practices for using them on your site …

Firstly…What is meta data?  In a nutshell, meta data is the information that is placed in the <head></head> part of your HTML (code) and primarily used to tell the search engines what your site’s pages are about as well as providing other useful data and information.   An example of meta data tags can be seen below:

 <head><title>Title goes here…</title>
<meta name=”description” content=”Description goes here..”/>
<meta name=”keywords” content=”Up to 5 keywords go here…”/>
</head>

This post will focus onthe three meta elements; Title Tag, Description Meta Tag and Meta Keywords tag, so lets go ahead and define each of these meta data elements:   

  • Title Tag: 

The title tag is the title of your page and shows up as the title of your page in the search engine results pages (serps) and also appears on the top of a user’s browser.  It is by far the most important meta element and its presence is absolutely mandatory.  The code for the title tag is as follows:

<title>your page’s title goes here</title>

  • Meta Description Tag:

The Meta Description tag is the focus of this post.  Basically, the meta description is not a mandatory tag but SEO best practice says you have to have it.  The code for the meta description is as follows:

<meta name=”description” content=”Description goes here..”/>

Here is why…

The meta description tag appears in the search results pages as the description snippet belwoe the title tag.  If no description tag is implemented on the site, the search engines will still find a content from the page for the description but in most cases that content will look shabby as it would contain content from various parts of the page including you breadcrumb, image alt tag or anywhere else the engine decides to get that content from.  This also leads to the description being cut off with a (…)  Very shabby!

Having a meta description tag allows you to havee control over the image of your company and more crucially it allows you to include call to action words such as buy now, or sign up today, etc…

  • Meta Keywords Tag

The meta keywords tag is no longer necessary or important but again, seo best practices states that you have to have it. In the past when search engines were new and unable to read the content of the page, they relied on this tag to rank pages.  Some search engines probably still do!   The code for the meta keywords is as follows:

<meta name=”keywords” content=”Up to 5 keywords go here…”/>

To sum up, my view on metas is that you have to have them. mainly for having a sharp looking listing which includes the appropriate call to action for your site.

Comments

Optimising Images on Your Site

Juicy Water Mellon
A very juicy water mellon

With the concept of “universal search“ gaining ground, it is becoming more and more crucial to optimise all content on your site for search including videos, pdf, podcasts and images.

This blog post will focus on optimising images on your site. 

As an example, if you wanted to optimise an image on your site for the keyword “juicy water mellon”,  implement the following three simple steps:

1) Image Filename:

Make sure your image file has an optimised name such as water-mellon.jpg and not image.jpg

<img src=”images/water-mellon.jpg” mce_src=”images/juicy-water-mellon.jpg” width=”257″ height=”329″>

2) Image Alt Tag:

Make sure all your images contain a keyword rich alt and title tags (the text you see when you hover over the image)  Example:

<img src=”images/water-melon.jpg” width=”257″ height=”329″ alt=”juicy water mellon title=”picture of a juicy water mellon”>

3) Image Caption and surrounding text:

Make sure your image has a descriptive caption under it and also make sure that the text surrounding the image is both thematic and semantic (ie is related to your image).

If you follow the above simple steps, you’ll have a good chance of your images being indexed and ranked in search engines’ image search algorithm.  This will drive more targeted traffic to your site.

Comments

Changing Charatcteristics of a File - Static to Dynamic

Did you know that you are able to change the characteristics of a static file such as a .html or .txt file to allow it to accept dynamic code such as php or asp?  Well you can, here’s how…

Lets say you’re looking to create a dynamic .csv  or .txt for a shopping feed for one of the shopping comparison search engines such as Shopping.com, normally, you would not be able to do so because .xml/.txt/.csv files are static and would not ordinalrily execute php commands to output the products from a database. 

The solution…

Place the following code in your .htaccess file:

<Files filename.csv>
ForceType application/x-httpd-php
</Files>

That should do the trick.  Change “filename” for your file’s name and the “.csv” to .xml, .txt or even .html depending on what you’re trying to accomplish.

Comments

This Site May Harm Your Computer

“This site may harm your computer”, this is what Google placed underneath all my listings towards the end of last week, why?… Well basically because a hacker managed to penetrate my server and place invisible code designed to place “trojan horses” onto my users’ computers.

If you’re unlucky enough to be tagged with ”This Site May Harm Your Computer” this is what your listing will look like:

this site may harm your computer

If you actually click on the listing, Google will proceed to take you to a page that looks like this:

this site may harm your computer - landing page

I spent the best part of the weekend cleaning up the mess the hacker left behind and trying to figure out a way to tell Google to remove the  ”This site may harm your computer” from my listings! I finally managed to do so on Sunday night when I discovered that the solution was right under my nose… Google’s webmaster tools!

If you don’t have a Google webmaster tools account I suggest you get one right away!  It is truly a fantastic interface that includes among other things, the quick soultion for the  ”This site may harm your computer” problem!.  Basically the interface tells you that your listings are marked with “This site may harm your computer” and gives you a sample of pages where the malicious code appears.  Its your job to go and clean that code and then submit a form telling Google that the code has been removed and request a review. 

Google will then review the site and if all is okay, it will remove the “This site may harm your computer” statement from your listings and all back to normal.  If the results of the review are negative, Google will let you know and will guide you further by giving you more sample urls were malicious coe (or malware/badware as they refer to it).  Once you’ve cleaned your whole site, Google will remove the “This site may harm your computer” from your listings.

Anyway, to cut a long story short,, sign up for a Google webmasters tool today.  I will blog separately about about this fantastic free service offered by Google so stay tuned…

Comments

« Previous entries

Add to Technorati Favorites