Love disolves anxiety and depression



Archive for the ‘Webmaster’ Category

XHTML Block Table Horizontal Center Align CSS Bug Fix for Internet Explorer 6

Sunday, April 12th, 2009

Approximately 75% of Internet users still use Internet Explorer with all its bugs and security risks.

Nearly half these users are still using Internet Explorer Versions 6 or below, which have many bugs that interfere with valid XHTML/CSS code. Professional organizations and even governments are still using this substandard browser.

To insure the cleanest possible code for picture pages, you may be making the shift to XHTML strict. Your pages/pictures may appear attractive in your own Firefox browser or when viewed by latest versions of Windows Explorer. However when approximately 40% of the entire population view your pages with Internet Explorer 6 or below your pages may look ugly, as a result of Explorer not centering your tables horizontally.

The normal way of centering tables in HTML 4 was with the <div align=”center”> tag. This tag has now depreciated in XHTML. So now we rely on CSS to do this for us.

However the usual and valid CSS in the following example does NOT work with Internet Explorer 6, as your tables will not be centered- making your photo pages look horrible. The following example is the normal valid way of centering block items such as tables horizontally:

table.center {margin: 0px auto;} or
table.center {margin-left: auto; margin-right: auto;}

The way to get around this bug is to use the following css:

table.center {text-align: left; margin: 0px auto;}
div.center {text-align: center; width: auto;}

Then make your tables you are having problems with look something like this:

<div class=”center”>
<table class=”center”>
<tbody>
<tr>
<td align=”center”>Your Pictures</td>
<td align=”center”>Your Pictures</td>
<td align=”center”>Your Pictures</td>
</td
</tbody>
</table>
</div>

Your tables now center perfectly even in Internet Explorer 6. Your page is also 100% valid XHTML strict.

Problem solved.

Importance of website directory/folder structures

Sunday, November 9th, 2008

When creating a website, it is important to have a good directory/folder structure- instead of having all your files in the root directory next to you index.html file.

It may be fine in the beginning stages of your website, but after a few years when you have many pages up to hundreds or even a thousand- it then becomes very difficult to manage your website and find stuff, because all your files are all over the place in the root folder. This is what happened to me. All my files were in the root directory. I had to move them into another folder.

The best thing to do, which also helps search engine spiders and robots index your site better is to have different folders/directories for different types of content. For instance if I had known about this from the beginning I would have a folder named “health”, a folder named, “spiritual” etc- all the
the different types of content on my site. This offers better management, organization and indexing of your pages.

It is impossible to administrate your site properly when you have all your files in the root directory. If your website is only going to have a few pages then fine, but otherwise your are going to be stuck. You will need to do something about this as soon as possible before your site gets any bigger.

It sounds simple just to move files. But any webmaster knows that moving files may be a complete disaster- because each page on a website should always have a permanent web address. If you move a page somewhere else, Google and all major search engines will treat it as a new page. It will then be given a page rank of less than zero and may not appear in the SERPS. It would mean that nobody would be able to find your pages in Google at all to begin with. When someone clicks on a page through Google- that page will no longer exist. It may destroy all organic traffic to your website.

How to safely move and redirect web pages with Apache web server using .htaccess files.

I found an excellent way of resolving this problem using a special type of “redirect” whereby the pages and the page rank gets redirected. Even though the old version of the page in the root directory is no longer there, if sometime tries to access that- then Apache redirects or rewrites the URL to the new page. It is a very clean method of moving pages permanently. When someone types in the old page into the address browser, your web server rewrites it to the new address automatically- so people do not even know that they have been redirected. This technique prevents duplicate content and any of your pages disappearing temporarily from the Google SERPS. It means that any links to your old pages will be valid, and the page rank passed on. It is such as genius technique.

This technique is called, mod_rewrite.

You should have a file called, .htaccess in your root directory. If you do not then create a file and call it .htaccess.

For example I moved all my pages such as introduction.html out of the root directory to the folder, “way_to_happiness”.

To do this I would open up my .htaccess file and type the following:

RewriteEngine on
RewriteRule ^introduction\.html$ http://www.anxietymadewell.com/way_to_happiness/introduction.html [R=301,L]

Upload this to the root directory.

Now if you type, “http://www.anxietymadewell.com/introduction.html” into your browser see what happens. It gets rewritten to “http://www.anxietymadewell.com/way_to_happiness/introduction.html” automatically.

Then all your problems are solved.

Free PHP Website Feedback Form- Sends Feedback by Email

Sunday, October 12th, 2008

I have been writing and developing my very first ever PHP script- a feedback form for my website.

This uses a basic HTML form to gather some feedback information from your visitors. It then posts this information to a PHP file, which returns a confirmation page. It also gets your web server to email you the feedback.

Although it is so simple, it took me a long time. But in the end I have a professional looking script, which you are welcome to use for free and modify to your particular needs and website.

I used an open source captcha image script I found on Google with my feedback form to stop the possibility of robots visiting my site that fill out forms and send spam.

So here is the script for form.php:
<?php
session_start();
if(($_SESSION['security_code'] == $_POST['security_code']) && (!empty($_SESSION['security_code'])) ) {
// Insert you code for processing the form here, e.g emailing the submission, entering it into a database.
$output = ‘<html>
<head>
<title>Feedback Form- Confirmed</title>
<link rel=”stylesheet” href=”../css/feedback.css” type=”text/css”>
</head>
<h1>Dear ‘.$_POST["FirstName"].’, thank you for your feedback!</h1>

You entered the following details:
<ul>
<li>Your name is ‘.$_POST["FirstName"].’ ‘.$_POST["LastName"].’</li>
<li>You are ‘.$_POST["Age"].’ years old and ‘.$_POST["sex"].’</li>
<li>You are from ‘.$_POST["Country"].’</li>
<⁄ul>
<p>You rate this site: </p> <p class=”gold”>’.$_POST["Value"].’</p>
<p>Your reason for this: </p> <p class=”green”>’.$_POST["comments"].’</p></p>
<p>And this is your suggestion on how to improve the site: </p> <p class=”green”>’.$_POST["improvements"].’</p>
<br><br>
<p>Click <a href=”../index.html”>Here</a> to return back to the main page</p>.
</body>
</html>’;

$to = “example@example.com”;
$subject = “Online Feedback Form - Example.Com”;
$message = $output;
$from = $_REQUEST["EmailAddress"];
$headers = “From: $from”\r\n”;
$headers = “Content-type: text/html\r\n”;

mail($to,$subject,$message,$headers);

echo $output;

unset($_SESSION['security_code']);

} else {

// Insert your code for showing an error message here

echo “The security code you typed seems to be invalid. Please go back, reload the page and try again. The information you typed in should still be there. Thanks.”;
}

?>


This is an example of a form you can use in HTML along with the form.php file and how it matches up:

<code>
<html>
<body>
<fieldset>
<legend>

AnxietyMadeWell.Com Feedback Form:
</legend>
<form name=”input” action=”feedback.php” method=”post”>
First name:
<input type=”text” name=”FirstName” size=”20″>
Last name:
<input type=”text” name=”LastName” size=”20″>
<br><br>
Your age:
<input type=”text” name=”Age” size=”4″>
<br><br>
Your Country/Location:
<input type=”text” name=”Country” size=”20″>
<br><br>
Email address:
<input type=”text” name=”EmailAddress” size=”20″><br><br>

<input type=”radio” name=”sex” value=”Male”> Male
<br>
<input type=”radio” name=”sex” value=”Female”> Female

<br><br>

How do you rate this site?<br><br>

Excellent:
<input type=”radio” name=”Value” value=”Excellent”>

Good:
<input type=”radio” name=”value” value=”Good”>

Okay:
<input type=”radio” name=”value” value=”Okay”>

Bad:
<input type=”radio” name=”value” value=”Bad”>

Terrible:
<input type=”radio” name=”value” value=”Terrible”><br><br>

<textarea rows=”5″ cols=”30″ name=”comments”>Why?</textarea>

<br><br>

<textarea rows=”5″ cols=”30″ name=”improvements”>How could this site be improved?</textarea>

<br><br>

<img src=”CaptchaSecurityImages.php”>
Security Code:
<input id=”security_code” name=”security_code” type=”text” size=”5″>
<br><br>

<input type=”submit” value=”Submit”>

</form>
</fieldset>
</body>
</html>

Importance of Blogs in Website Development, Link Building and Search Engine Optimization

Friday, June 27th, 2008

The biggest reason for having a blog is that the Internet absolutely loves blogs. If you have a blog you can submit it to thousands of blog directories and RSS newsfeed directories. This means that a good quality blog can get you over a thousand backlinks to your website. This tremendously helps your website rank well in the search engines. Because of this it would be silly not to have a blog. Having a blog makes a lot of sense!

There are several other common reasons for having a blog as part of your website. A blog is a great way of…

  • Publishing your latest news
  • Keeping in contact with the world
  • Sharing professional knowledge and expertise
  • Talking about stuff you like or find interesting

Love = sharing. It is good share what you have, such as any knowledge or expertise including but not limited to your professional knowledge.

There is also a great need on the Internet for tips on search engine optimization and website development- for serious people with quality websites or those who want to bring something of value to the world. Think how many websites there are on the Internet that want to improve and do well? As my website becomes successful I will share my professional knowledge. Whatever you learn in life and whatever you are an expert in- you can share this with the world to help other people become successful.

If your website has quality content then people will naturally want to link to your site and it will become successful over time.

How to avoid duplicate content with syndicate article submission sites such as Ezinearticles and Digg

Tuesday, February 5th, 2008

Recently I have been submitting pages from my website as syndicate articles, to article submission websites such as Ezinearticles and Digg. I thought that this would be a great way of marketing and promoting my content and a great way of building backlinks for my website and improving pagerank. I thought that as long there is a link back to my website in these articles then Google would be fine with this type of duplicate content. I was wrong.

This was the worst idea and I will never do it again. When Google finds multiple pages of the same content it will put all pages into dispute, which means Google may temporarily remove all of the duplicate content (including your original) from the search engine results pages until they decide who the original site/author is, or which site Google feels would be the best to display this content. If Google finds multiple pages/sites of the same content it will only index one of those pages/sites. After a day of high traffic you may find that all content disappears for a few hours, a few days or a few weeks whilst Google has a dance and makes a decision. So this can threaten the entire existence of your pages in the Google index.

Some say that if your syndicated articles have a link back to your own site- then you will be fine and it will help maintain and improve your page rank. But then any website that shows your article may loose their site/pages in the index. Also the article submission websites may not like this and end up deleting your articles, and all your content may be seen as spam by search engines.

Google is quite good at determining who the original site/author is, however at the end of the day having syndicated articles duplicated from your website content is not benefiting anybody at all. When lots of different publishers start using your duplicate content articles then this will severely threaten your pages existence in the Google index and undermine the exclusiveness and integrity of your content and website.

So far today I have been deleting all duplicate content from all article submission sites and emailing these sites asking them to remove the duplicate content. The lesson here is that although we like to look for the most efficient path in life, there are never any short cuts. If you want something in life you have to pay the bill in terms of hard work and energy.

The scary thing is that because some of my content is interesting and well written a lot of companies would like to publish this on their website. I am now in the process of telling webmasters that it would be detrimental for them as well as my own site to post this content on their website.

It is more safer and easier just to write unique articles for these sites, which don’t duplicate any website content. With a link back to your website, web publisher’s can then do what they like with your articles and this will help your page rank. If you follow this method it will save you a lot of anxiety. The best syndication is RSS news feeds, which I will be spending a lot of time on over the next few months or so.