Admin Life Errors, Fixes, and Encounters

14May/10Off

SEO Traffic Tip #3

Choose a memorable domain name.

If you're launching a new site, choose a name people will remember easily.

Years ago, I visited a site called "forkinthehead.com". Its logo is a man with a fork in his head. Sounds dreadful, doesn't it?

However, all it took for me to remember that unusual site was ONE visit years ago.

You may not wish to go to such extreme lengths, but at least ask yourself: "Will people remember my domain name?"

At my four main sites, a large percentage of the visitors are people who have remembered the domain name and typed it directly into their browser. (I also own a site built in 1996 which has a totally impossible to remember URL, but that's another story.)

Try to choose a name which won't be confused with similar names. You don't want people typing your competitor's domain name when they’re trying to find your site.

NameBoy.com has a handy tool to help you choose domain names. Also, you can find a surprising number of good deleted (expired) domain names at Whois.net. Both those tools are free.

Copyright 2006 Allan Gardyne Pty Ltd ATF Allan Gardyne Trust

Filed under: SEO No Comments
13May/10Off

SEO Traffic Tip #2

Keep ADDING fresh, relevant, useful content.

According to Google, about half the 2.5 billion searches done a day at Google are for unique, one-off phrases.

The more pages you build full of on-topic material, the better the chances your site will be found.

When it comes to keywords, think big. You want your site to be found via THOUSANDS of different phrases every month.

Then you can lure that traffic to your best money-generating pages or to your newsletter sign-up page.

Also, search engines prefer fresh sites which keep gradually adding new content. Don't let your site go stale.

Super affiliate James Martell says:

"My own rule of thumb is this: Add a minimum of 1 article per week, 2 preferably. Adding an article daily is euphoria and adding 1 every six hours, well, that's the best."

Copyright 2006 Allan Gardyne Pty Ltd ATF Allan Gardyne Trust

Filed under: SEO No Comments
12May/10Off

SEO Traffic TIP #1

Traffic tip #1

You MUST have high quality, unique content if you want long-term,
free search engine traffic.

This is the most important tip of all. Sadly, it's one which many website
owners ignore.

Provide LOTS of information-rich, keyword-rich, useful content for the search engines and humans to find.

You know that search engines are being clogged with junk at an alarming rate. The other day, I came across a marketer who was boasting that he owned more than 20,000 blogs - and he's not the only one.

Consider the scary effect of this exponential increase in low quality blogs and websites. Old, large, well established sites will inevitably become more and more important and trusted by the search engines.

Owning a large, well established, high quality site is a very solid investment in your future.

These days, even Google's webmaster guidelines advise affiliates to publish "unique and relevant" content.

If you spend time thinking of ways to provide truly USEFUL content that people will talk about, you'll automatically end up with lots of free, one-way links to your site as people recommend it without even being asked to do so.

I've been building information-rich websites ever since I created my first site in 1996. This method has worked extremely well for me and continues to work very well.

If your website helps solve people's problems, they'll love you for it.

Copyright 2006 Allan Gardyne Pty Ltd ATF Allan Gardyne Trust

Filed under: SEO No Comments
18Mar/10Off

Changing your hosts file in Vista

By default, if you try to modify your hosts file in windows Vista, it will not let you save it. It tells you that you don't have permission. To successfully modify the hosts file, run notepad.exe as an administrator open the file. This is a windows vista and windows 7 issue and does not need to run in windows XP

1 ) Browse to Start -> All Programs -> Accessories
2 ) Right click "Notepad" and select "Run as administrator"
3 ) Click "Continue" on the UAC prompt
4 ) Click File -> Open
5 ) Browse to "C:\Windows\System32\Drivers\etc"
6 ) Change the file filter drop down box from "Text Documents (*.txt)" to "All Files (*.*)"
7 ) Select "hosts" and click "Open"
8 ) Make the needed changes and close Notepad. Save when prompted.

Here is a sample of what the hosts file looks like
I added 3 banner sites at the bottom as an example of what you can add.
In this example, everytime your browser tries to go to bannersite1.com bannersite3.com or bannersite3.com
your computer will answer with nothing... which causes no banners to come up!

# Copyright (c) 1993-2006 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost
::1 localhost
127.0.0.1 bannersite1.com
127.0.0.1 bannersite2.com
127.0.0.1 bannersite3.com

26Feb/10Off

jquery ajaxform validation preview save and edit buttons

My goal was to have a page where a user can edit, save, and preview whatever he's working on using jquery and ajaxForm.

The problem is that after after you preview, the save doesn't work anymore because the validation submit handler can't be reinialized.

Original Code

<code>
HTML code....
<form action="ajax/check.php" method="post" enctype="multipart/form-data" name="signup" id="signup">
<div id="edit_company">
<input name="name" type="text" id="name" value="" />
<textarea name="description" cols="45" rows="6" id="description"></textarea>
</div>
<div id="preview_company" style="display:none;" >
<center>
<img src='images/loading.gif' alt='loading...' /> <br />
Loding Please Wait...
</center>
</div>
<div id="preview_company_buttons" style="display:none; text-align:center; padding-top:10px;" >
<input type="submit" name="save" id="save" value="Save" />
<input type="submit" name="edit" id="edit" value="Edit" />
</div>
</form>
HTML code....
<script type="text/javascript">
$(document).ready(function() {

$.ajaxSetup ({
cache: false
});

var options = {
target: '#company_upgrade'   // target element(s) to be updated with server response
};

$("#save").validate({
rules: {
name: "required",    // simple rule, converted to {required: true}
description: {
required: true
}
},
messages: {
name: "&nbsp;&nbsp;<strong>Required</strong>",
description: "&nbsp;&nbsp;<strong>Required</strong>"
},
submitHandler: function() {
$('#preview_company').hide('fast');
$('#edit_company').hide('fast');
setTimeout("$('#company_upgrade').show('slow')", 500);
$('#signup').ajaxForm({target: '#company_upgrade'});
}
});

$("#preview").validate({
rules: {
name: "required",    // simple rule, converted to {required: true}
description: {
required: true
}
},
messages: {
name: "&nbsp;&nbsp;<strong>Required</strong>",
description: "&nbsp;&nbsp;<strong>Required</strong>"
},
submitHandler: function() {
$('#edit_company').hide('fast');
setTimeout("$('#preview_company').show('slow')", 500);
setTimeout("$('#preview_company_buttons').show('slow')", 1000);
$('#signup').ajaxForm({target: '#preview_company'});  // bind form using 'ajaxForm'
}
});

// hides the slickbox on clicking the noted link
$('#edit').click(function() {
$('#preview_company').hide('fast');
$('#preview_company_buttons').hide('fast');
setTimeout("$('#edit_company').show('slow')", 500);
return false;
});

});
</script>
HTML code....
</code>

The new code fixes the the issue by putting the validation in an if condition.

<code>
HTML code....
<form action="ajax/check.php" method="post" enctype="multipart/form-data" name="signup" id="signup">
<div id="edit_company">
<input name="name" type="text" id="name" value="" />
<textarea name="description" cols="45" rows="6" id="description"></textarea>
</div>
<div id="preview_company" style="display:none;" >
<center>
<img src='images/loading.gif' alt='loading...' /> <br />
Loding Please Wait...
</center>
</div>
<div id="preview_company_buttons" style="display:none; text-align:center; padding-top:10px;" >
<input type="submit" name="save" id="save" value="Save" />
<input type="submit" name="edit" id="edit" value="Edit" />
</div>
</form>
HTML code....
<script type="text/javascript">
$(document).ready(function() {

$.ajaxSetup ({
cache: false
});

var options = {
target: '#company_upgrade'   // target element(s) to be updated with server response
};

var val_save = {
rules: {
name: "required",    // simple rule, converted to {required: true}
description: {
required: true
}
},
messages: {
name: "&nbsp;&nbsp;<strong>Required</strong>",
description: "&nbsp;&nbsp;<strong>Required</strong>"
}
};

// hides the slickbox on clicking the noted link
$('#save').click(function() {
if ( $("#signup").validate(val_save).form() ) {
$('#preview_company').hide('fast');
$('#edit_company').hide('fast');
setTimeout("$('#company_upgrade').show('slow')", 500);
$('#signup').ajaxForm({target: '#company_upgrade'});
}

});

// hides the slickbox on clicking the noted link
$('#preview').click(function() {
if ( $("#signup").validate(val_save).form() ) {
$('#edit_company').hide('fast');
setTimeout("$('#preview_company').show('slow')", 500);
setTimeout("$('#preview_company_buttons').show('slow')", 1000);
$('#signup').ajaxForm({target: '#preview_company'});  // bind form using 'ajaxForm'
}
});

// hides the slickbox on clicking the noted link
$('#edit').click(function() {
$('#preview_company').hide('fast');
$('#preview_company_buttons').hide('fast');
setTimeout("$('#edit_company').show('slow')", 500);
return false;
});
});
</script>
HTML code....
</code>

Filed under: Code, CSS, Errors, HTML No Comments
24Jan/10Off

PHP

Just upgraded PHP or change hosting providers and your code seems to have stopped working? Look at php.ini (usually found in /usr/local/etc/php.ini) There is a section that disables short tags for future compatibility.

If any of your code used instead of well, your code needs to be changed. Or better yet, enable short tags in php.ini, restart apache and you should be good to go.

24Jan/10Off

css fixed background image

One interesting thing to do with websites it to have a fixed background image. Even if the user scrolls up and down the background stays in place. This can add a nice effect if the background has a fade effect.

How is this done? Easily with CSS.
All you need to do is 4 things, add the following to your CSS file.

body {
background-image:url(/images/background.jpg);
background-attachment: fixed;
background-repeat:repeat-x;
background-position:bottom;
}

"background-image" is the image you want to use.
"background-attachment" fixes the image to the screen.
"background-repeat" this makes the image repeat via the x-axis (left to right)
"background-position:" where should the image be? in our case, the bottom of the screen.

That's it.

Filed under: Code, CSS, HTML No Comments
21Jan/10Off

memcached php mysql freebsd

Too many slow queries running on MySQL and some can not be fixed without a major change? Here's a potential solution, cache it!

Step 1) Install memcache, in this case on FreeBSD

1. cd /usr/ports/databases/memcached; make install clean
2. vi /etc/rc.conf, and add memcached_enable="YES"
3. /usr/local/etc/rc.d/memcached start
4. run "netstat -an" to check that a process is listening on TCP 11211
5. cd /usr/ports/databases/pecl-memcache ; make install clean
6. /usr/local/bin/php -i | grep -i 'memcache'
7. Play with memcached in PHP scripts

step 2)
use memcache in your scripts!

Filed under: MySQL, PHP No Comments