Is your website in Google's sandbox?

Ever wondered why your website is getting less and less visits?
One reason for this might be that your website is in a google's sandbox so you get no traffic from google queries.
There are some signs of that you might be sandboxed:
1. Drop in the number of website visitors referenced by google.com .
2. Sudden drop in the google's PageRank of all website pages.
3. When querying google on specific keywords - your website appears in the last 2-3 pages of the search results.
4. Your website is banned from google's listing.

If you wish to check whether this applies to you then try the following 3 methods:

I Method
Use this web address to check the indexing of your website pages against specific keyword:

http://www.searchenginegenie.com/sandbox-checker.htm
and the second one which is more reliable:

II Method
Run your web browser and go to: http://www.google.com

then type in the search box:
www.yourwebsite.com -asdf -asdf -asdf -fdsa -sadf -fdas -asdf -fdas -fasd -asdf -asdf -asdf -fdsa -asdf -asdf -asdf -asdf -asdf -asdf -asdf

If your website appears in the search results and has good keyword ranking then your website is in the google's sandbox.

III Method
Run your web browser, go to: http://www.google.com and type:
site:www.yourwebsite.com

If there are no results found and then your website is out of google's indexing database. The difference between non-indexed fresh websites and sandboxed ones that on latter you'll not see:
If the URL is valid, try visiting that web page by clicking on the following link: www.yourwebsite.com

IV Method
When running google query then add at the end of the URL:

&filter=0

This will show all the results from the primary and supplemental google index of your website. If your website has been penalized then its results will be in the supplemental index.


Next you can take a look at the following articles to know how to get your website out:

by Nevyan Neykov



Guide to better accessible forms

Lots of people want to know how to make their web forms more accessible and still good functioning. Here I'll present you nice ways to do this. First let clear some rules about:

Accesibility:
1. Ensure that the web form will be still functioning without JavaScript(or when JavaScript is disabled). Most of the users today have turned on firewall, antispyware utility that blocks JavaScript actively or have disabled their JavaScript from the browser .
2. Provide one-way descriptions that will make user to type something instead of wasting time in reading labels or legends.

Example:


3. Ensure that the user knows exactly where he/she is typing by placing CSS borders around your input and textarea boxes.

CSS Example:

textarea:focus {background:#fffff6;border:2px inset red;}


4. Align fields so that it is intuitively to the user what field or action follows.

CSS Example:
textarea
{
overflow:auto;
}

label
{
width: 10em;
float: left;
text-align: right;
margin-right: 0.6em;
display: block;
cursor:pointer;
}

.submit input
{
margin-left: 10.6em;
color: #000;
background: #ffa20f;
border: 2px outset #d7b9c9;
cursor:pointer;
font-weight:bold;
}

You must add class="submit" in your webform.


5. When using AJAX, hide the form or disable its Submit button when the action is completed ie. user has posted a message. This way you'll prevent duplicate messages from one user.
JavaScript Example: Hide the whole form:
document.getElementById('feedback_form').style.display='none';
JavaScript:
1. Perform javascript checks on the typed information and return warnings to the user if needed. That method is faster than using AJAX to return error messages. For more information use this website: http://onlinetools.org/articles/unobtrusivejavascript/chapter5.html

2. Use unobtrusive javascript:
  • Check that the client browser supports Javascript and DOM.
  • Run JavaScript code after the actual web page loads.
  • The only JavaScript code on your page must be the loading one:
<script laguage="javascript" href="code.js"></script>
Data protection:
In case that you don't want your email box to be filled with unwanted spam messages you must implement a good way of protection over your web forms. There are many ways to do this. Here I'll present you 2 of them:

1. Use CAPTCHA on your forms.
Advantages: Gets rid of almost all spam.
Disadvantages: Reduces simplicificy to the user.
More information here: http://en.wikipedia.org/wiki/Captcha

2. Never show the actual form action URL.
How? - via AJAX request to submit forms.
Advantages: You will receive no spam.
Disadvantages: Form will become inaccesible when JavaScript is disabled.
Example: <form name="feedback_form" id="feedback_form" method="post" action="">


Actual XHTML code:
Enough with requirements. Lets build our form:

<form name="feedback_form" id="feedback_form" method="post" action="">
<fieldset>
<label for="feedback">Your opinion:</label>
<textarea id="feedback" name="suggest" cols="18" rows="6">Text...</textarea>
<input value="Send >" name="Submit" type="submit">
</fieldset>
</form>


And the Javascript code:

if (!document.getElementsByTagName || !(document.createElement || document.createElementNS)) return;

if (document.getElementById)
{window.onload = myUnobtrusiveBehavior;}

function myUnobtrusiveBehavior() {
if (document.getElementById("feedback_form")) {
document.getElementById("feedback_form").onsubmit = function () {
send_feedback(); return false;
};
}


function send_feedback()
{
makePOSTRequest('feedback_run.php', 'suggest=' + escape( document.getElementById('feedback').value));
document.getElementById('feedback_form').style.display='none';
}
Here are the other helpfull Javascript functions: for making the actual AJAX request and displaying status to the user:
var http_request = false;
function makePOSTRequest(url, parameters) { http_request = false;
if (window.XMLHttpRequest) {http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) { http_request.overrideMimeType('text/xml'); }
} else if (window.ActiveXObject) {
try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {
try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}
}
}
if (!http_request) { alert('Cannot create XMLHTTP instance'); return false; }
http_request.onreadystatechange = alertContents;
http_request.open('POST', url, true);
http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http_request.setRequestHeader("Charset", "windows-1251");
http_request.setRequestHeader("Content-length", parameters.length);
http_request.setRequestHeader("Connection", "close");
http_request.send(parameters);
}

function alertContents() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
result = http_request.responseText;
document.getElementById('myspan').innerHTML = result;
} else { alert('There is a problem in making the comment request. Please try again later.'); }
}
}

That is it. Save the code in two separate files and test it. I hope you will have a better accessible forms!

Update: in the form element insted of using
<input value="Send >" name="Submit" type="submit">
use:
<input value="Send >" name="Submit" type="button">
This will ensure that browsers without JavaScript won't run the form call.
by Nevyan Neykov



Avoid problems between Web forms and .htaccess

One good search engine optimization(SEO) technique states:
To ensure a better spidering of web pages web sites should use static(.html) files instead of dynamic(.aspx, jspx or php) ones.
Many people have converted their dynamic web sites using .htaccess file and in particular mod_rewrite module in Apache. Thus the webserver represents to the client a dynamic page with its parameters as a static one.

Example: http://www.website.com/index.php?mode=look_article&article_id=421

becomes

http://www.website.com/article-421.html

Results are that the search engines will have no trouble accessing/spidering the whole website content and the Url becomes friendlier to the users.

However your website may not work the same as before. So here are some advices on using of Forms that will keep you away from future trouble:

If you are using web forms it is easier and more secure to write them:
form method="post" action="?mode=list_comments"
instead of
form method="post" action="index.php?mode=list_comments"
These examples both work fine but let's see what happens when our urls gets rewritten by .htaccess file rules.

For example our aim is to post a comment. We have 2 cases:

1. Good: If we are on the home page or "index.php".
Then all of our forms will work because inside the form action="?mode=post_comment" will be translated by .htaccess to action="index.php?mode=post_comment" and then from the internal website engine to action="post_comment.php" that will actually post the comment.

2. Bad: When we are on different than index.php page.
For example let's suppose that we are looking an article. Our url inside the form action attribute will be:
form action="article-421.html?mode=post_comment"
this gets translated to:
form action="index.php?mode=look_article&article_id=421&mode=post_comment"
Translated by our server the first part ?mode=look_article will execute but the second mode=post_comment will not. So our form will not run and the server will give us again the article.

The solution:
In order your forms to be accessible and run from everywhere: use full form Urls as action attributes
Example:
form action="index.php?mode=post_comment"
Hope it will help you!
by Nevyan Neykov