Getting your Visitor's Details Using PHP

Written by Vinu Thomas


You can get quite a bit of information about your visitors without having to use a third party tracking software. I'll outlinerepparttar PHP commands you can use to capture some of this data. The details you capture can be saved into a database, and retrieved later to check your site's performance and user details. The following information is captured usingrepparttar 105922 server variable ($_SERVER) which is available from PHP 4.10 onwards.

Visitor's IP address :

You can getrepparttar 105923 visitor's IP address usingrepparttar 105924 following command:

<? $ip = $_SERVER['HTTP_CLIENT_IP']; ?>

This will give yourepparttar 105925 vistor's IP address. You can use this along with an ip to country converter database to see from which country your visitors are come in from. You can head over to http://ip-to-country.webhosting.info/ for one such script.

You can use PHP to resolverepparttar 105926 ip address to a domain name to getrepparttar 105927 visitor's ISP in most cases. The ISP's domain will show up if PHP is able to resolverepparttar 105928 IP to a proper domain. You can do this as follows.

<?

$ip = $_SERVER['HTTP_CLIENT_IP'];

$visitor_host = @getHostByAddr( $ip );

?>

Note : On some servers, using getHostByAddr to resolve domains may causerepparttar 105929 script to slow down.

Referring Page :

You can capturerepparttar 105930 referring page, which will give you an indication of which site is sending traffic to you.

<? $referrer_page = $_SERVER['HTTP_REFERER']; ?>

This will give yourepparttar 105931 entire URL from whichrepparttar 105932 visitor came to your site. For example ifrepparttar 105933 visitor came from a google search for "i-pod",repparttar 105934 referrer url would look something like this :

http://www.google.co.in/search?q=i-pod&hl=en&lr=&ie=UTF-8&start=50

If you don't wantrepparttar 105935 entire URL captured, but justrepparttar 105936 domain name stored intorepparttar 105937 database, you can striprepparttar 105938 rest ofrepparttar 105939 URL and save it torepparttar 105940 database like so:

<?

SEO 101 – the basics of how to get to the top of the search engines

Written by Rob Rawson


By Rob Rawson

Search Engine Optimization (commonly referred to as SEO) is one ofrepparttar best waysto get traffic to your site. The best thing about SEO is thatrepparttar 105921 traffic you get is free! If you manage to get top ten listings in a major search engine like Google, you can get hundreds or even thousands of visitors to your site. Depending on your site’s subject matter, you might even be able to start earning a significant income purely fromrepparttar 105922 popularity of your site. For example, if you have a site on jokes you might be able to get a substantial amount of traffic, but you’re unlikely to earn a huge income. Onrepparttar 105923 other hand, if you have a top ranking site on Google forrepparttar 105924 keyword phrase “web hosting”, you’ll be able to earn at least $1-2 million (probably more like $3-4 million) per year from that site alone. However, to get intorepparttar 105925 top 10 in Google forrepparttar 105926 phrase “web hosting” is extremely difficult, you would need to be a search engine pro to do it - even then, it might take you two years to get there with a team of 5 people working aroundrepparttar 105927 clock. A profitable site will be based on a good keyword phrase, a good topic (or subject material) and be different enough to stand out fromrepparttar 105928 competition. If you can combine these elements successfully you’ll increase you chances of turning a profit from your site. Keep in mind that there are a number of niche areas where there is not so much competition but stillrepparttar 105929 opportunity to make a decent profit. There are hundreds of such areas where you haverepparttar 105930 potential to earn $500-2000 per month.We’ll talk about keyword research and finding profitable niche areas in later issues, but for now, let’s look atrepparttar 105931 basics of how to get a site torepparttar 105932 top ofrepparttar 105933 search engines.

I’m going to focus on SEO for Google because it’srepparttar 105934 largest (andrepparttar 105935 best) search engine which will generaterepparttar 105936 most traffic, especially if you can master all ofrepparttar 105937 right optimization methods. Google has a very complicated system for determining which sites make it torepparttar 105938 top ofrepparttar 105939 search engine. There are manyfactors involved and there is no precise formula. A further consideration isthat Google often changes its formula so you can’t rely on it beingrepparttar 105940 same from month to month. However, there are a few key factors which are unlikely to change dramatically: Keywords phrases should be one ofrepparttar 105941 most important considerations when you are optimizing your site (remember that for each page ofrepparttar 105942 site you should concentrate on one or two keyword phrases). Keyword phrases (which you want to get torepparttar 105943 top ofrepparttar 105944 search engine for)should be well researched. For more information on researching keywords, have a look at http://www.profitpuppy.com/keyword-research.htm where you can find links to useful keyword tools. Key factors for getting torepparttar 105945 top of Google: The keyword phrase inrepparttar 105946 title ofrepparttar 105947 page - you should haverepparttar 105948 phrase inrepparttar 105949 title ofrepparttar 105950 page. The keyword phrase inrepparttar 105951 text ofrepparttar 105952 page – you wantrepparttar 105953 keyword phrase to be uprepparttar 105954 top ofrepparttar 105955 page, preferably as high uprepparttar 105956 top ofrepparttar 105957 code onrepparttar 105958 page as possible. You also wantrepparttar 105959 phrase repeated a few times onrepparttar 105960 page. Don’t worry about how many times, just at least 3-4 times and more if you think it fits in naturally withrepparttar 105961 content ofrepparttar 105962 page. Includerepparttar 105963 keyword phrase in a large font heading with H1 tags (this may make a small difference). Links into your site from other sites (covered in more detail below). Links within your site (covered below). Links to other sites (covered below). Links into your site from other sites This is probablyrepparttar 105964 most important factor for getting good search engine listings. You need to have good links coming into your site from other sites.

You want those links to be from popular sites that also have lots of links coming into them. Google uses a Page Rank system which is a rough measure of how many links are coming into your site. You want links from sites that have good Page Rank. Creating 50 of your own sites and interlinking them won’t increase your page ranking. How do you get links from other sites? The main ways are to: Create a great site that people naturally want to link to, Get an affiliate program so people can link to your site and get paid, swap links with other sites, get listed in directories such as dmoz.org and buy links from people who have sites with a high PR (Page Rank). Again, we’ll be talking about this in more depth in another issue ofrepparttar 105965 newsletter. The most important consideration with incoming links is that you need to haverepparttar 105966 keyword phrase inrepparttar 105967 link that directs traffic to you your site. Getting listed in directories such as DMOZ (Open Directory Project) can also help you significantly in getting a good search engine ranking in Google. Links within your site

It helps once again if you haverepparttar 105968 keyword phrase inrepparttar 105969 links to each page of your site. For example, let’s say you have a site on baby products and you have one page where you are trying to optimize forrepparttar 105970 keyword phrase “cheap baby supplies”. You should make sure that links that come into that page haverepparttar 105971 phrase “cheap baby supplies” so that your links look like this: Click here for cheap baby supplies

Links to other sites You can improve your page rank if you link to other sites that have high search engine listings forrepparttar 105972 phrase that you are trying to optimize for. Note: it can also hinder if you link to pages that are off-topic. For example, you don’t want to link to a chemical arms factory from your baby supplies site. Some other things you don’t want to do (and some things that make no difference at all) are: - Repeatingrepparttar 105973 keyword phrase multiple times onrepparttar 105974 page unless it makes contextual sense. - Placing hidden links on your site – for example, links that arerepparttar 105975 same color asrepparttar 105976 background ofrepparttar 105977 page won’t be recognized by Google. - Optimizing your site too carefully – if it’s obvious that you have optimized your site for Google (for example, if all your incoming links userepparttar 105978 same keyword phrase) you may be penalized. Google looks for sites that are more ‘natural’ in their structure, so if all links lookrepparttar 105979 same this won’t look like an organic site to Google robots and you may be penalized for it. - Despite popular opinion, Meta tags don’t really help at all. However,repparttar 105980 description tag is important because that isrepparttar 105981 description that will appear in your listing on Google. Finally, you may have heard of people using automated pages and or ‘cloaked pages’ to get high search engine rankings in Google. Personally, I don’t believein taking this approach as it’s a non-sustainable way of getting high search engine rankings (that’s not say that some people who aren’t very successful at it). I know of atleast 3 highly successful companies who generate automated pages using this software http://www.profitpuppy.com/traffic. This is a sneaky way to make it torepparttar 105982 top of ofrepparttar 105983 search engine rankings, but it can work; one guy I know is earning several million dollars per year using this technique. So it can work, but as I mentioned before, I don’t think it’s sustainable andrepparttar 105984 Google engine doesn’t take kindly to it.

Cont'd on page 2 ==>
 
ImproveHomeLife.com © 2005
Terms of Use