How to check Link popularity or back links for a domain in php

Tuesday, April 20, 2010 5:06
Posted in category PHP

How to check Link popularity or back links for a given domain in php?

Link popularity is a measure of the quantity and quality of other web sites that link to a specific site on the World Wide Web. It is an example of the move by search engines towards off-the-page-criteria to determine quality content. In theory, off-the-page-criteria adds the aspect of impartiality to search engine rankings. Link popularity plays an important role in the visibility of a web site among the top of the search results. Indeed, some search engines require at least one or more links coming to a web site, otherwise they will drop it from their index.

Search engines such as Google use a special link analysis system to rank web pages. Citations from other WWW authors help to define a site’s reputation. The philosophy of link popularity is that important sites will attract many links. Content-poor sites will have difficulty attracting any links. Link popularity assumes that not all incoming links are equal, as an inbound link from a major directory carries more weight than an inbound link from an obscure personal home page. In other words, the quality of incoming links counts more than sheer numbers of them.

We can know Link popularity in google and Yahoo for given domain name in PHP.

It can be achievd by some simple logic and here is that logic for you.

</span>

<?php
// Setting the URL variable
$link = $_POST['url'];

// Google Backlinks
function fetch_google($uri) {
$uri = trim(eregi_replace('http://', '', $uri)); $uri = trim(eregi_replace('http', '', $uri));
$url = 'http://www.google.com/search?hl=en&amp;amp;lr=&amp;amp;ie=UTF-8&amp;amp;q=links:'.$uri;
$v = file_get_contents($url);
preg_match('/of about \<b\>(.*?)\<\/b\>/si',$v,$r);
return ($r[1]) ? $r[1] : '0';
}

// Yahoo Inlinks
function fetch_yahoo($uri) {
$uri = trim(eregi_replace('http://', '', $uri)); $uri = trim(eregi_replace('http', '', $uri));
$url = 'http://siteexplorer.search.yahoo.com/search?p=http://'.$uri.'&amp;amp;bwm=i&amp;amp;bwmf=s&amp;amp;bwmo=&amp;amp;fr2=seo-rd-se';
$v = file_get_contents($url);

preg_match('/Inlinks \((.*?)\)/si',$v,$r);
return ($r[1]) ? $r[1] : '0';
}

// Alexa Rating
function fetch_alexa($uri){
$uri = trim(eregi_replace('http://', '', $uri)); $uri = trim(eregi_replace('http', '', $uri));
$url = 'http://data.alexa.com/data?cli=10&amp;amp;dat=snbamz&amp;amp;url=' . urlencode($uri);
$v = file_get_contents($url);
preg_match('/\<popularity url\="(.*?)" TEXT\="([0-9]+)"\/\>/si', $v, $r);
return ($r[2]) ? $r[2] : '0';
}

// Page Header
echo "<h2>Search Engine Popularity</h2>";

// Display Links and Information
if (isset($link)) {
echo "<strong>URL:</strong> " . $link . "<br />";
echo "<strong>Google Backlinks:</strong> " . fetch_google($link) . "<br />";
echo "<strong>Yahoo Backlinks:</strong> " . fetch_yahoo($link) . "<br />";
echo "<strong>Alexa Rating:</strong> " . fetch_alexa($link) . "<br />";
}

// Search Form
echo "<br />
<form action=\"<?=$_SERVER['PHP_SELF'];?>\" method=\"POST\">
<input type=\"text\" name=\"url\" />
<input type=\"submit\" />
</form>";

?>

<span>

DNS propagation

Monday, April 19, 2010 7:33
Posted in category Altmint

What is DNS propagation.

When a new domain name is registered (or an existing one is transferred to a new DNS), the information must be updated in the entire ISP’s and root servers around the world. This updating process is called as DNS propagation.

DNS propagation time and Problems during the propagation.

Any time that DNS changes are made on any level, you will need to wait for the propagation to complete and this will usually takes 3-4 days (72-96 hours). During propagation, traffic may come to either location. One person may see the new server while the other person sees the old one. Also, your domain name may work and may not too. All of this is normal during propagation. This means that just because you go to the new site when you type in the domain name does not mean that propagation is complete.

Detailed explanation of propagation

DNS stands for Domain Name Service. Every time you go to a web site using a domain name, you are using DNS. Your request for that domain name goes to your local primary or secondary DNS server which is usually administered by your ISP. Your local DNS server check its records to see if it knows what IP address that domain points to. If it does, then it directs you to that IP address. If it does not, then it sends a query to the Root DNS servers.

The Root servers are what make the process work. When a domain is registered, it is added to the Root servers. When a domain is expired, it is removed from the Root servers. The Root servers tell your local DNS server which DNS servers are the authorities for your domain.

Your local DNS server then queries the authorities DNS server, and that server tells your local DNS server what IP address is the domain located. Your local DNS server then caches the information. This process is essential because it does not only does it speed up future queries but also reduces the load on the Root servers.

This process leads to the propagation.
Your local DNS server will not keep that information forever. It will be kept for a certain amount of time, at one point it deletes it. The next time, which is after the information is deleted when you try to visit that domain, the process will start all over again.

DNS Propagation Check

DNS Propagation will usually takes 3-4 days (72-96 hours).   There are a lot of tools available on the web to check DNS propagation. With the DNS propagation checkers you can verify that with a few DNS servers around the world.  Enter in a domain name and it will check what IP it is associated with through several ISP DNS caches.

99% of the time this is completely useless, but if you have just moved a domain name this can be helpful to see how the propagation is going.

How to Speed up DNS Propagation

The well-known way to do this, is to lower your TTL values for a while before making a DNS change.  However, there are three big issues with this:

1) sometimes you don’t know when you’ll be making such a change

2) lots of ISPs set the DNS TTL to several days, and stubbornly refuse to make an exception for you, particularly because you generally ask them when you are leaving as a customer.

3) Various client programs and DNS client modules do their own caching, and do not process DNS TLL anywhere near correctly.

I have now concluded that to be completely safe (i.e., no person or search engine will think your site is missing), you should allow a week overlap – the server at the old IP address should continue to work for that duration.

Private Domain Name Registration

Friday, April 16, 2010 6:08
Posted in category Altmint

Private Domain Name Registration

A private domain registration will keep your personal information (name, email address, etc.) out of the global Internet database, and will prevent a lot of spam from reaching your email box.  You have the option of getting a private domain registration with every domain you register.

ICANN, the governing body of domain names requires every registrar to maintain a publicly accessible WHOIS directory for all domains that are registered.  This means your personal information is made available to anyone who wants to see it.

With a private domain registration, you can keep your personal information private via a new and unique process that is supported by two patent applications.

With a private domain registration, domain company name, address and phone number are made publicly available in the WHOIS directory — not yours.

Litigation

With “private registration”, the private registration service is the legal owner of the domain. This has occasionally resulted in legal problems.

In a trademark infringement case, a 2009 United States District Court ruling in U.S.A. held that, for domains with “private registration”, the privacy service is legally the “owner” of the domain. The privacy service acts as the “cyber-landlord of the Internet real estate”, and the domain is “licensed” to the customer of the privacy service.

Registering a domain name

Friday, April 16, 2010 5:02
Posted in category Altmint

Registering a domain name

Registering a domain name is one of the first steps in establishing a web site. The domain name identifies your website on the Internet.

There are three steps involved in registering a domain name:

Choosing the domain name
Checking if the domain name available
Registering the domain name

Choosing the domain name

  1. Don’t register domain names that are too long. You can register names up to 63 characters long, but that doesn’t mean you have to use all 63 characters.
  2. Include keywords in the name- A keyword is a word that will be used by people searching the net. I highly recommend you register a name that contains your major keywords instead of your company name. If it has already been taken the consider using it in a combination separated by hyphens, because all search engines treat the hyphens as spaces
  3. Consider registering a generic name, if one that makes sense for your organization is still available.
  4. Try to choose a name that has positive connotations in all languages.

Checking if the domain name available

To register a domain name, it is simply a matter of performing a domain name ‘look up’ to find a name that isn’t already taken (since all domain names must be unique).

Registering the domain name

There are many domain registration companies available. It doesn’t matter where you register your domain. Every registrar provides the same services.

Here I am listing some affordable / cheap domain registration companies.

GoDaddy.com – World’s No.1 Domain Name Registrar

IX Web Hosting

Top Level Domains

Tuesday, April 13, 2010 7:10
Posted in category Altmint

Top-Level Domains

A domain name “extension” is called a “top-level domain (TLD).” These are divided into three different categories: generic top-level domains (gTLD), country code top-level domains (ccTLD) and infrastructure top-level domains.

Generic top-level domains are the ones most frequently seen on the Web:

  • .com (originally intended for use by commercial organizations but is available to anyone).
  • .net (originally intended for use by sites directly related to the internet  but is available to anyone).
  • .org (originally intended for use by non-profit organizations but is available to anyone).
  • .edu (used by educational organizations).
  • .gov (reserved for agencies of the United States government).
  • .mil (reserved for the United States military).
  • .int (reserved for international organizations established by treaty. i.e. the European Union: http://europa.eu.int).
  • .aero (reserved for members of the air transport industry).
  • .biz (for use by businesses only).
  • .coop (reserved for cooperative associations).
  • .info.
  • .museum (reserved for museums).
  • .name (reserved for individuals).
  • .pro (being developed for professionals and related entities).

The next top-level domains are the two letter country codes. These are used to designate a country or a dependent territory. For instance, in the URL http://bsnl.in/, the “in” represents the India. A listing of all country codes can be found on the IANA Web site. IANA (Internet Assigned Numbers Authority) oversees the allocation of all TLD’s.

The top-level domain infrastructure is limited to “.arpa” and is used exclusively for Internet-infrastructure purposes. The .arpa designation comes from the United States Department of Defense Advanced Research Projects Agency, the government agency which formulated the Internet.

What is a Domain Name?

Tuesday, April 13, 2010 4:36
Posted in category Altmint

What is a Domain Name?

Internet domain names are the alphanumeric identifiers we use to refer to hosts on the Internet. Such as Altmint.com or yourquidget.com

These are all domain names which are registered by official registrars with various domain name authorities. These authorities make up part of an international database or “domain name system” overseen by the Internet Corporation for Assigned Names and Numbers (ICANN).

Domain naming system

Internet domain names are organized by their levels, with the higher levels on the right. For example, for the domain “www.altmint.com” the top-level domain is “com”, the second-level domain is “altmint.com”, and the third-level domain is “www.altmint.com”.

Top-level domains

In the Domain Name System… there is a hierarchy of names. The root of system is unnamed. There are a set of what are called “top-level domain names” (TLDs). These are the generic TLDs (EDU, COM, NET, ORG, GOV, MIL, and INT), and the two letter country codes from ISO-3166.

Second-level domains

Second-level domains are registered by individuals and organizations.  This is the actual name of your website.

Domain names must be at least two characters long and no more than 63 characters maximum, excluding the top level domain. The characters can include any combination of letters, numbers or hyphens. The first and last character cannot be a hyphen. Domain names are not case-sensitive

Third-level domains

Third-level Internet domain names i.e host names / sub domains are created by those that own second-level domains.

Get a domain name’s IP address with PHP

Friday, April 9, 2010 7:36
Posted in category PHP

How to get Domain name’s IP address with PHP ?.

It’s very easy to get the IP address for a domain name using PHP. We have two powerful functions in php to get the IP address of a domain name.

Those functions are

  1. gethostbyname()
  2. gethostbynamel()

The first one will return  IP address corresponding to a given Internet host name

The second one will return a list of IP addresses corresponding to a given Internet host name in the form of an array.

We will see some examples using the both functions

Using gethostbyname()

The PHP function gethostbyname() is very simple to use. Simply pass it the domain name you would like to look up and it will either return the IP address for that domain or the unmodified domain back again if it failed. If the domain has more than one IP address associated with it (as with www.cnn.com) then just a single IP address will be passed back.

Example 1


<?php

$x = gethostbyname('www.altmint.com');
var_dump($x);
// outputs string(13) "96.0.1.231"

?>

Example 2


<?php

$x = gethostbyname('www.cnn.com');
var_dump($x);
// string(14) "157.166.255.19"
// OR string(14) "157.166.255.18"
// OR string(14) "157.166.224.26"
// OR string(14) "157.166.224.25"

?>

Example 3

This example is for a non-existant domain and returns the domain itself instead of an IP address:


<?php
$x = gethostbyname('www.blah.foo');
var_dump($x);
// outputs string(12) "www.blah.foo"

?>

If you needed to do something based on the IP address not being found, you could do something like this:


<?php
$domain = 'www.blah.foo';
$ip = gethostbyname($domain);
if($domain != $ip) {
// do something
}

?>

Note that not being able to find an IP address for the domain does not mean the domain does not exist, or even that a record does not exist for this (sub)domain. The DNS lookup may simply have failed.

Using gethostbynamel()

The PHP gethostbynamel() function returns a list of IP addresses for a domain and Take a look at the following Example.

Example


<?php
$hosts = gethostbynamel('www.example.com');
print_r($hosts);

//Possible out put will be like this.

Array
(
[0] => 192.0.34.166
)

How to Create a Website

Friday, April 9, 2010 6:55
Posted in category Altmint

Welcome! If you found this page, you are obviously ardent to know what is involved in making a website.  Let’s start from here.

What You Need to Start Your Website

There are two things you absolutely must have to build a website:

1) A domain name

2) A web host

Once you got these two things, then I can say you are ready to build your site.

What is a domain name?

Before you even think about building your website, you should register a domain name. A domain name is the thing that looks like this: “yourdomain.com”.

Your domain name represents the URL (or permanent web address) of your website. Therefore, when anyone types in “yourdomain.com” or “www.yourdomain.com”, they will see your website.

You register your domain name through a domain name registrar. You register this on an annual basis.  Domain name can cost anywhere between $4 and $50 per year.

Find a Web host

Once you got the domain name now it is the time to host the website.  Web hosting is a service which allocates space for your websites on computer servers that are connected to the Internet 24/7.

You can host your website at your place or buy some plan from a web hosting company.

A good hosting plan can be anywhere between $10 per month and many thousands per month.

Build your Website

You can either build it yourself or use a web developer or firm to do that. Website building basically involves 2 steps: Making a web page and setting up a website.

Outsourcing Web design and development work

Thursday, April 8, 2010 4:51
Posted in category Altmint

Common Outsourcing Concerns

Outsourcing is an arrangement in which one company provides services for another company that could also be or usually have been provided in-house. US companies are outsourcing their web development work to India because of the drastically lower rates and access to better technology.  Also by outsourcing the companies can concentrate on their core business.

Here we are discussing  a few common outsourcing concerns.

Time zone differences:

At 11AM here in the US its around 11PM in India. It’s not always easy to get someone on the phone. Often you have to wait 24 hours for a reply to your email.

Some companies like ours are providing the support in US timings.

Language:

While an overseas designer may be able to communicate verbally with passable English, the real problem is often the business concept and more abstract ideas. I have seen clients that were simply unable to communicate the concepts of their business with an overseas developer. I think it is more of a cultural difference than a simple language problem.

We can overcome this problem by exactly written specification document.

Missed Deadlines:

I have been approached by several clients who come to me and say. I hired a developer in India and it is been a long time and the site is still not working. Either the designer took another job or had some other issue that is keeping them from finishing your project. When you are only paying someone $6 an hour to do technical work, it’s very easy for them to find better pay or not make time for it.

It is better to hire a firm to overcome this issue.

Fraud:

I have heard some horror stories from clients who have paid deposits only to get a small portion of work done, and then the developer disappears! Luckily most designers overseas only charge once the work is delivered.

How to know Mysql Version Using PHP

Thursday, April 8, 2010 2:11
Posted in category Mysql, PHP

How to know Mysql Version Using PHP ?.

We can know the mysql version in the phpinfo. But if we want to display the mysql version in any web page dynamically, how we are you going to deal with that ?.

A little bit logic and a liitle bit manipulation on the phpinfo information we can achieve that.

Create a file like this and name it as phpinfo.php

<?php
phpinfo();
?>

Create another file mysql_version.php with the following code

<?php
$file = @file_get_contents("http://DOMAINNAME/phpinfo.php");
$start = explode("<h2><a name=\"module_mysql\">mysql</a></h2>",$file,1000);
if(count($start) < 2){
echo "MySQL is not on this server.";
}else{
$again = explode("<tr><td class=\"e\">Client API version </td><td class=\"v\">",$start[1],1000);
$last_time = explode(" </td></tr>",$again[1],1000);
echo "MySQL Version: <b>".$last_time[0]."</b>";
}
?>

replace “DOMAINNAME” with your domain name.

This is one of the solution.

You can also know the mysql version if you are using a linux  server and you have the permission to execute the shell commands, the following code will work.

<?php
function find_SQL_Version() {
$output = shell_exec('mysql -V');
preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $output, $version);
return $version[0];
}
echo 'Your SQL version is ' . find_SQL_Version();
?>

If any one know other than these methods please feel free to share with us.