Archive for January, 2009

High Priorities for Great SEO

Sunday, January 11th, 2009

Write Great Content » I’ve worked with many web clients who want their site to be ranked high in the search engines, and want people to be able to find their site by searching for all sorts of keywords, problem is they don’t want to put in the work of writing good content (or pay a professional to do the writing). If you’re content isn’t good, your SEO won’t be good either. Period. And don’t just copy-and-paste from a competitor’s site with good rankings, your content needs to be unique.

Keep Content Fresh » Sites with newer content are often viewed as more relevant and reliable. Take advantage of this and keep your content up-to-date and relevant.

Choose Your Keyword Phrase Wisely » Too many people want to treat keywords and SEO like shooting a shotgun just hoping something will hit. I like to tell our clients to be very specific and choose just a very specific few keyword phrases to concentrate on first for just the homepage. Make certain that keyword phrase is popular (but not too popular – You’ll get more pageviews from a less popular keyword when you’re on the first page of the search engines, than from a super popular keyword that you only make it to page 50 of search engines.), describes what you are actually selling/advertising, and is something people would actually search for.

Use Your Keyword Phrase In Your Page’s Title » The title tag is one of the most important tags on your entire Web page. Placing your keyword phrase in the title tag is very important to get that phrase into the search engines and get your site ranked higher.

Use Your Keyword Phrase In Your Page’s Headings and Links » After the title tags, the Heading tags (<h1></h1>, <h2></h2>, and <h3></h3>) and links are the next most important tags in your web page, respectively. Both of these sets of tags have higher visibility than the rest of the surrounding text, and also more influence on your site’s ranking.

Use Your Keyword Phrase An Appropriate Amount » What is an “appropriate amount” you might ask? Well, the ratio of your keywords to the rest of the text on your page is called the keyword density. Keyword density should be between 3 and 7% for your primary keyword phrase and 1-2% for any secondary keywords or keyword phrases. So make certain to repeat your keyword phrase, but not excessively.

Self-Submitting PHP Tell-A-Friend form

Tuesday, January 6th, 2009

Want to put a “tell a friend” form on your website so visitors can easily tell their friends about your site?  Below is the code for a self-submitting PHP tell-a-friend form (which could also easily be adapted as a standard contact form).

Simply change “domain” to your website URL, and paste the code where you want the form to appear on your site.  Your may also want to customize the message displayed to the user after they submit the form (near the bottom of the code).

<?php
if (!$_POST['tellafriend']) {
$frm = $_SERVER['PHP_SELF'];
?>
<form name=”tellafriend” id=”tellafriend” action=”<?php echo $frm; ?>” method=”post”>
<table border=”0″ cellpadding=”0″ cellspacing=”0″ width=”260″>
<tr>
<th colspan=”4″>Tell A Friend</th>
</tr>
<tr height=”4″>
<td colspan=”4″></td>
</tr>
<tr>
<td width=”10″></td>
<td>Your Name:</td>
<td><input type=”text” name=”yourname” size=”20″ /></td>
<td width=”10″></td>
</tr>
<tr height=”4″>
<td colspan=”4″></td>
</tr>
<tr>
<td></td>
<td>Your Email:</td>
<td><input type=”text” name=”youremail” size=”20″ /></td>
<td></td>
</tr>
<tr height=”4″>
<td colspan=”4″></td>
</tr>
<tr>
<td width=”10″></td>
<td>Friend’s Name:</td>
<td><input type=”text” name=”friendname” size=”20″ /></td>
<td width=”10″></td>
</tr>
<tr height=”4″>
<td colspan=”4″></td>
</tr>
<tr>
<td></td>
<td>Friend’s Email:</td>
<td><input type=”text” name=”friendemail” size=”20″ /></td>
<td></td>
</tr>
<tr height=”4″>
<td colspan=”4″></td>
</tr>
<tr>
<td></td>
<td colspan=”2″>Add A Personal Message:</td>
<td></td>
</tr>
<tr>
<td></td>
<td colspan=”2″><textarea cols=”26″ rows=”8″ name=”comments”></textarea></td>
<td></td>
</tr>
<tr>
<td></td>
<td colspan=”2″><input type=”hidden” name=”tellafriend” value=”tellafriend” /><input type=”button” name=”send” value=”Submit” onclick=”tellverify();”></td>
<td></td>
</tr>
<tr height=”4″>
<td colspan=”4″></td>
</tr>
</table>
</form>
<?php
} else {
error_reporting(0);

$siteaddress =”http://www.domain.com”;
$sitename = “Domain.com”;
$adminaddress = “tellafriend@domain.com”;
$date = date(“m/d/Y H:i:s”);
$headers = “From: tellafriend@domain.com <tellafriend@domain.com>”;

$name = $_POST['yourname'];
$email = $_POST['youremail'];
$friendname = $_POST['friendname'];
$friendemail = $_POST['friendemail'];
$comments = stripslashes($_POST['comments']);

// Gets the IP Address
if ($REMOTE_ADDR == “”) $ip = “no ip”;
else $ip = getHostByAddr($REMOTE_ADDR);

ini_set(“SMTP”,”mail.domain.com”);
ini_set(“smtp_port”,”25″);  //could also be 26
ini_set(“sendmail_from”, “tellafriend@domain.com”);

if ($comments) {
$comments2 = “Your friend $name also wanted to say: \n  $comments”;
}

mail(“$friendemail”,”Your friend $name thought you might be interested in this site”,
“Greetings $friendname, \n
Your friend $name ($email) found our website, http://www.domain.com, and thought you may be interested in it.

$comments2

Logged Info :
——————————
Using: $HTTP_USER_AGENT
Hostname: $ip
IP address: $REMOTE_ADDR
Date/Time:  $date”,$headers);

mail(“$adminaddress”,”Tell a friend”,
“Name: $name
Email: $email
Friend’s Name: $friendname
Friend’e Email: $friendemail

Logged Info :
——————————
Using: $HTTP_USER_AGENT
Hostname: $ip
IP address: $REMOTE_ADDR
Date/Time:  $date”,$headers);

echo(“message to display on website here”);
};

?>

Javascript: Print Page button

Tuesday, January 6th, 2009

here’s a very simple javascript to place a link on a webpage to facilitate the user’s printing of that page:

simply paste the code below where you want the button to appear:

<SCRIPT LANGUAGE=”JavaScript”>
<!– Begin
if (window.print) {
document.write(‘<form>Click Here To ‘
+ ‘<input type=button name=print value=”Print” ‘
+ ‘onClick=”javascript:window.print()”> This Page!</form>’);
}
// End –>
</script>

Javascript: Display Random Text from a list

Monday, January 5th, 2009

Did you ever want to display a random text from a pre-populated list?  Maybe you wanted to randomly display a client testimonial from a list of 10… well, here’s the script you need.

place the following code in the head of your document (somewhere between the <head> and </head> tags):
<script type=”text/javascript” src=”../scripts/rotate.js”></script>

now, place the following code in the body of your document, where you want the random text to be displayed:
<script language=”JavaScript”>
<!–
document.write(r_text[i]);
–>
</script>

then, create a javascript document named rotate.js with the following code:
var r_text = new Array ();
r_text[0] = “random text 1″;
r_text[1] = “random text 2″;
r_text[2] = “random text 3″;
r_text[3] = “random text 4″;
r_text[4] = “random text 5″;
r_text[5] = “random text 6″;
r_text[6] = “random text 7″;
r_text[7] = “random text 8″;
r_text[8] = “random text 9″;
r_text[9] = “random text 10″;

var i = Math.floor((r_text.length)*Math.random())

and edit the texts.  You can add or delete as many lines of random texts as you wish and they will automatically be included.  Then save it in a subdirectory named “scripts”.

That’s all you need!