Saturday, November 19, 2011

Get Top Position and boost web traffic through Search Engine Rankings

Get Top Position and boost web traffic through Search Engine Rankings

Use Search Engine Rankings tips step by step to increase and boost your web traffic.

1. Optimize the Title Tag :- Title is the most important factor of search engine rankings. Make sure to include your primary keyword in your title of post. You should begin your title with your primary keyword if possible.

2. Optimize the Permalink :- You shoud use your main primary keyword in permalink and avoid useless words like and, to, with, a, an, for, in good Search Engine Optimize permalink.

3. Optimize the H1, H2, H3 Tags :- Include your primary, secondary keyword with your H1, H2, H3 Tags. This is most important factor in search engine optimization. These heading tags will give better idea to search engine to cowl your contents.

4. Ensure the Minimum Word Count :- Remember one thing that google likes big quality post. Make sure that your post include minimum 250+ words.

5. Improve Your Keyword Density :- You should keep 3% to 5% keyword density for better position in Search Engine Rankings. If you’re using wordpress blog then there are various types of plugins available on the net for Keyword density on the net.

6. Optimize the Image ALT Attribute :- You must include one image with alt attribute with your keyword to increase and boost your traffic. This tweak will give your post better seo score. You can optimize your search engine rankings in image search too using this tip.

7. Decorate Your Keyword :- Google search bot will get better idea if you have used your primary and secondary keyword with bold, italic and underline tag in your post. Use your keyword in first and last 25-50 words.

8. Optimize the Internal and External Links :- If you need 100% seo score then your one internal link and use No follow attribute in external link.

How to mix JavaScript and PHP

Just as you can easily mix HTML and PHP you can also mix JavaScript and PHP. But why would you mix PHP and JavaScript?

As you probably know that both PHP and JavaScript are used to develop web-based applications (mostly) but the big difference is that PHP is a server side scripting language and JavaScript is a client side scripting language. This means the code of PHP runs on the server and that of JavaScript runs inside your browser, locally.

Since both the programming platforms have their respective strengths sometimes we need to combine them in order to create optimal applications. Whereas PHP is great for handling databases, intricate programming logic, and lots of other stuff that happens on the server, JavaScript is great for creating compelling user experience and interface.

Given below is the easiest example you can refer to in order to understand how to mix JavaScript and PHP:





Don’t worry about the simplicity of the example, just focus on the logic. This also explains why sometimes we need to use JavaScript even if we are creating entire application in PHP. With PHP you cannot display an alert box the way you can do it in JavaScript.

The if-else condition could have been anything, and it doesn’t have to be conditional whenever we have to mix JavaScript and PHP. And you could have also outputed the JavaScript portion using the echo or print command of PHP.

Refrence From seo services


How to use Google+ page to your advantage

Google+ is rapidly creating a worthy opponent to Facebook. Aside from offering almost all the features that Facebook offers, now Google+ also allows you to create branded pages that you can use to promote your business, personal brand and even a political ideology. A few days ago we discussed how to create a Google+ page. Now let us explore some ways you can take advantage of your Google+ page for the benefit of your business or brand.

Create an appropriate Google+ page profile

Right information and representation always matters especially on the Internet when people hardly know you (no matter for how long they have been your “friends” and followers on various social networking websites). It is very important that when you’re creating a Google+ page you create a profile that fully communicates what you stand for. Use your business logo or a header as a profile picture, use the right title (preferably the title of your business), and enter all the information the Google+ page creation interface asks you while creating the page.

And appropriate Google+ page profile also helps the right people to connect to you. This further makes your Google+ page updates more effective.

Add a Google+ 1 icon to your website or blog

You can encourage people to follow your Google+ page by clicking the icon on your website or blog. If they already have a Google+ 1 account and are logged in you can either encourage them to add your Google+ page to one of their existing circles (or create a new circle and then add your Google+ page it) or 1 it.

Reach out to people using Google+

The most obvious advantage of having a Google+ page for your business is that you can reach out to millions of people already using Google+ . It is actually same as taking advantage of your Facebook fan page. You can create hangouts where you can invite people for a lively interaction using text, voice and video chat. Of course you can also share your business news and other important stuff concerning your business with people following you through your Google+ page. Just like any social networking presence, through your Google+ page too the primary focus must be to constantly keep in touch with people who have connected to you via your page.

This will be an evolving blog post as more and more material on Google+ pages becomes available. Do pitch in your own suggestions regarding how you can use your Google+ page to your advantage.

Refrence from web development services


Monday, November 14, 2011

Find a product from an incorrectly added product code or model using MYSQL Regular expression

Ever been searching for a particular product online by a model or product code? It could be a brand spanking new super thin LCD or the latest Adidas Predator football boots. You know exactly what you want and you are armed with the model or code of your product. You are now going to shop around looking for the best price and check out the reviews. You don’t need to browse for the product by name or go to an online shop and find after browsing that they don’t sell the exact thing you are looking for as you know what you want.

Have you ever found that you don’t actually have the correct code or model. You are sure you have it, but you just can’t find it. Do you give up? The problem is that you may have seen a model or code that has a “0″ (the number zero) in it and you have it down as an “O” (the letter o). That along with a number of other similarly looking combinations can mean you don’t find your product online. Take for example the product code “C602E/SS”. This could also be “C6O2E/SS” or even “C602ESS” without the forward slash.

Think about how that would affect you if you were an online business. You may have got the model or code from an advert or something, but simply wrote it down incorrectly. The way around this for an online shop is to search for all the different possible combinations of a searched model or code and return the results. Basically if you type in the wrong code you should still get the results.

We will look at swapping the following combinations:

  • 1 to l and l to 1

  • 1 to i and i to 1

  • l to i and i to l

  • 0 to o and o to 0

  • 5 to s and s to 5

  • 2 to z and z to 2

  • 8 to b and b to 8

  • removing /

  • removing .

  • removing spaces


To do this we could use PHPs string_replace and build all the possible string combinations within a MySQL OR statement. The problem with this is that if you use the 10 replacements above for each letter the longer the model or code the bigger the number of combinations there are. In this example we have an eight letter code. This results in an 8 to the power of 10 result: 1,073,741,824 possible combinations. This is why regular expressions are so powerful. Let’s see how.
  // Get our search from the post
$product_code = $_GET['product_code'];

// Setup our string that will hold the regular expression.
$regexp_search = '';

// Firstly we need to remove certain characters visitors may
// add that are not in the product code.
$replacements = array('/', '-', '.');

// The regular expressions will handle the uppercase and
// lowercase combinations so lets make it all lowercase.
$search = strtolower($product_code);

// Do an extra clean to make sure we have no special characters.
// Most product codes aren't going to have special characters.
$search = preg_replace("/[^a-z0-9]?/", "", $search);

// Split the product code into an array of letters so we can go
// through them individually.
$search_parts = str_split($search);

// Go through each letter and check to see what the alternatives
// could be and build the regexp search.
// For each letter also add the possibility that a ".", "-", or "/" may
// proceed the letter. This is useful if a visitor enters a code, but
// forgets a ".", "-", or "/"
foreach ($search_parts as $search_part)
{
switch ($piece_part)
{
// Find and upper and lower possible combinations for 1
case "1":
$regexp_search .= "(1|l|i|L|I|1/|l/|i/|L/|I/|1-|l-|i-|L-|I-|1.|l.|i.|L.|I.)";
break;
// Find and upper and lower possible combinations for l
case "l":
$regexp_search .= "(1|l|i|L|I|1/|l/|i/|L/|I/|1-|l-|i-|L-|I-|1.|l.|i.|L.|I.)";
break;
// Find and upper and lower possible combinations for i
case "i":
$regexp_search .= "(1|l|i|L|I|1/|l/|i/|L/|I/|1-|l-|i-|L-|I-|1.|l.|i.|L.|I.)";
break;
// Find and upper and lower possible combinations for 0
case "0":
$regexp_search .= "(0|o|O|0/|o/|O/|0-|o-|O-|0.|o.|O.)";
break;
// Find and upper and lower possible combinations for o
case "o":
$regexp_search .= "(0|o|O|0/|o/|O/|0-|o-|O-|0.|o.|O.)";
break;
// Find and upper and lower possible combinations for 5
case "5":
$regexp_search .= "(5|s|S|5/|s/|S/|5-|s-|S-|5.|s.|S.)";
break;
// Find and upper and lower possible combinations for s
case "s":
$regexp_search .= "(5|s|S|5/|s/|S/|5-|s-|S-|5.|s.|S.)";
break;
// Find and upper and lower possible combinations for 2
case "2":
$regexp_search .= "(2|z|Z|2/|z/|Z/|2-|z-|Z-|2.|z.|Z.)";
break;
// Find and upper and lower possible combinations for z
case "z":
$regexp_search .= "(2|z|Z|2/|z/|Z/|2-|z-|Z-|2.|z.|Z.)";
break;
// Find and upper and lower possible combinations for 8
case "8":
$regexp_search .= "(8|b|B|8/|b/|B/|8-|b-|B-|8.|b.|B.)";
break;
// Find and upper and lower possible combinations for b
case "b":
$regexp_search .= "(8|b|B|8/|b/|B/|8-|b-|B-|8.|b.|B.)";
break;
// Build the combination with upper and lowercase options
default:
$regexp_search .= "(".$search_part."|".strtoupper($search_part)."|"
.$search_part."/|".strtoupper($search_part)."/)";
break;
}
}

// Build the mysql query
$mysql = "SELECT * FROM products WHERE (product_code REGEXP '".$regexp_piece."');

 

Window.Location in jquery in IE(6)

Now then, what can I say about my favourite browser that is in my view Microsoft’s best invention! Crap!

Simple as that for now. I will reserve a separate blog for discussing IE6 another time – or should I say rant. As a web developer I probably spend approximately a third of any development time fixing IE6 bugs. 2014 cannot come soon enough when Microsoft stop supporting the nightmare. Until then…

Had an interesting issue today: it turns out that if you use window.location in a function you need to make sure you return false otherwise the navigation will not work. No error, just nothing. Puh!

For example, I was doing a very simple click function using JQuery as below:
$("#test_link").click(function()
{
window.location = 'http://www.google.co.uk/';
});

To make it work in IE6 I had to use:
$("#test_link").click(function()
{
window.location = 'http://www.google.co.uk/';
return false;
});

To be fair to Microsoft they are correct though. We should in fact return something in a function. It is after all good programming, but if is not semantically correct, which is clearly why IE6 does not do anything then why doesn’t it trigger an error? For me it is lazy coding, which is what the web is all about and it is a shame that we have to spend hours trying to work back to our roots to find out why a perfectly well-coded site does not work in an archaic browser. Rant over :-)

 

Creating your own file browser for CKE editor in PHP

I am going to talk to anyone out there about how you can create your own file browser for CKEditor. Before you say it CKEditor to provide a file browser and uploader called CKFinder that you can purchase for $59. This article is not about how to develop a file browser to replace this because you don’t want to pay for CKFinder as frankly CKEditor on it’s own is worth paying that for. No, this article is about writing your own file browser because you need something different (although there is no reason why you couldn’t build your own). My only gripe with the boys at CKEditor is although there support guide are detailed they aren’t quite there yet, but as they are probably spending most of their time developing a great product who am I to complain. Instead I am happy to try and help them out with this post.

Firstly it is useful if you get a feel for how CKEditor recommend you to develop your own file browser and uploader. If you go to their support article on it here and have a quick read.

I am also only showing you an example for the image upload area, but you can change this for the flash or general browser. It will work the same. I have tested it.

I use the JQuery adapter to initiate CKEditor, so I will start their with my initiation code (for more information on this visit Initiating CKEditor with JQuery and Using JQuery UI Dialog):

The filebrowserImageBrowseUrl is the URL that you would use. The content displayed for this page is displayed in the pop-up that appears when you click the browse button. Adding this config variable will add the browse button to the image dialog. The other URLs you can also develop are:

  • filebrowserBrowseUrl

  • filebrowserImageBrowseUrl

  • filebrowserFlashBrowseUrl

  • filebrowserUploadUrl

  • filebrowserImageUploadUrl

  • filebrowserFlashUploadUrl


I am going to keep things simple and give you the basics, so you can take this further and will simply add a couple of links to the pop-up that will load into the image dialog.

So let’s go through it!

There are two links that when clicked call the loadFile function passing an image URL. The first line of the function is where I cam so stuck with the documentation from CKEditor. In their documentation it says:
window.opener.CKEDITOR.tools.callFunction(
funcNum, fileUrl [, data] );

The issue here is window.opener! Very messy for cross-browser compatibility. I have added a check to the DOM that then selects the right object.

The second line contains the ‘CKEditorFuncNum’ variable that is pushed to your dialog box from clicking the browse button in the image dialog box through the query string. This variable basically tells CKEditor what object you are working on and where to send the URL back to. On this line you can see the CKEditor function that passes back the object instance function through CKEditorFuncNum variable as the first parameter. The second parameter is the URL to the image file and the third parameter can be a message. I kept things simple, but you can take this further and provide a message in here if things go wrong. The message is ignored if the URL parameter is not blank, but if the URL parameter is blank the message is displayed in an alert box. This could be useful if you develop your own upload tool. It is this line that sends the URL back to the image dialog box.

The third line simply closes our dialog box.

That should be that in a nutshell. Hopefully it will give you enough to overcome the issues I had to start with. Let me know if you need any further help.

 

Saturday, November 5, 2011

Add Google Analytics to Your Blogger Blog

Grab Your Google Analytics Code Block

  1. Login to Google Analytics at http://google.com/analytics/. The main Settings page loads.
  2. Click on Add Website Profile. A form displays.
  3. Select Add a Profile for a New Domain.
  4. Enter the URL of your site or blog.
  5. Select your country and time zone. Click Finish.
  6. Analytics provides you with a code block – a swatch of HTML – to add to your site’s pages.
  7. Highlight the code block and then copy it by selecting Edit > Copy or Ctrl-C or Command-C.

Add the Google Analytics Code Block to Your Blogger Blog

  1. Login to http://www.blogger.com/. The Dashboard loads.
  2. Under the blog you want to add Analytics tracking to, click on Layout or Template.
  3. Click on Edit HTML. An editing screen for your blog template’s HTML displays. Don’t freak out. Just scroll to the bottom.
  4. Look for the end of the template. It’ll look like:



(Google Analytics Code Block is going to go here!!!)

  1. Put your cursor right before that tag.
  2. Paste the Google Analytics Code Block by selecting Edit > Paste, Ctrl -V or Command-V.
  3. Click Save Changes.

You have now added the Google Analytics Code Block to Your Blogger Blog.

Check Your Work

  1. To ensure that you have successfully added the Google Analytics Code Block to your Blogger blog, go back to http://google.com/analytics/.
  2. Next to your blog’s URL it will say either Receiving Data (you were successful) or Tracking Not Installed (something is amiss).
  3. If it said Tracking Not Installed, click on Check Status. Google then checks your blog for the Analytics Code Block and reports back if it find it or not.
  4. If not, try re-pasting the Code Block in.