السبت، 2 أكتوبر 2010

معلومات عن حالات الدومين

معلومات عن حالات الدومينات
مثلا التسجيل (تسجيل دومين)
حذف الدومين
اعادة تسجيله وجميع المراحل التى يتم فيها تغيير معلومات الدومين وحذفه وتسجيله من خلال الصورة ادناه

Pending Delete Cycle

How domain names expire

Many people believe that domains expire at the exact moment that they say. The truth of the matter is that a domain that does not get renewed will actually go through a 75 day process after the expiration date before it is actually available for someone else to pick up. When the owner of a domain does not renew that name by the renewal date, that domain name will go into an expired status. For the next 40 days the domain will stay in a grace period where all services of that domain are turned off - however the domain owner still has the option to renew the domain by paying the standard renewal fee.

Now, once the domain enters the grace period you have your first indication that it may not be renewed at all. But, since the domain can be renewed by the original owner without paying a penalty you may also assume that they will pick it back up before the grace period ends. Some owners simply forget or put-off renewing their domains until they are ultimately forced to do so or lose that domain.

After the 40 day grace period ends the domain's status will be changed to a redemption period. During this period the WhoIs information for that domain will begin to drop. Also during this period if the original owner of that domain decides that he does want to keep it he will be required to pay an additional re-activation and re-registration fee. This fee is typically around $100 but the amount will depend on the registrar. If a domain has entered the redemption period you can just about bet that the original owner has decided to let it go and not renew it.

There is one phase left after the redemption period. Once this period ends the domain will have a locked status as it begins the deletion period. The deletion period lasts only 5 days. On the last day of this period, typically between 11am and 2pm Pacific Time that domain name will be completely dropped from the ICANN database. Once this happens anyone is free to register that domain name.
(Click on the image to enlarge)
Pending Domain Cycle
Now that you know and understand the process of a domain name being dropped it is important to delve into the process to understand how each phase works. Following are explanations of the status codes for domain names.

Domain Name Status Codes:

ACTIVE: The registry sets this status. A domain can only be modified by the domain registrar. The domain can be renewed. The domain will be included in the zone if the domain has been delegated to at least one name server.

REGISTRY-LOCK: The registry sets this status. The domain can not be modified or deleted by the registrar. The registry must remove the REGISTRY-LOCK status for the registrar to modify the domain. The domain can be renewed. The domain will be included in the zone if the domain has been delegated to at least one name server.

REGISTRAR-LOCK: The sponsoring registrar sets this status. The domain can not be modified or deleted. The registrar must remove REGISTRAR-LOCK status to modify the domain. The domain can be renewed. The domain will be included in the zone.

REGISTRY-HOLD: The registry sets this status. The domain can not be modified or deleted by the registrar. The registry must remove the REGISTRY-HOLD status for the registrar to modify the domain. The domain can be renewed. The domain will not be included in the zone.

REGISTRAR-HOLD: The sponsoring registrar sets this status. The domain can not be modified or deleted. The registrar must remove REGISTRAR-HOLD status to modify the domain. The domain can be renewed. The domain will not be included in the zone.

REDEMPTIONPERIOD: The registry sets this status when a registrar requests that the domain name be deleted from the registry and the domain has been registered for more than 5 calendar days (if the delete request is received within 5 days of initial domain registration it will instead be deleted immediately). The domain will not be included in the zone. The domain can not be modified or purged; it can only be restored. Any other registrar requests to modify or otherwise update the domain will be rejected. The domain will be held in this status for a maximum of 30 calendar days.

PENDINGRESTORE: The registry sets this status after a registrar requests restoration of a domain that is in REDEMPTIONPERIOD status. The domain will be included in the zone. Registrar requests to modify or otherwise update the domain will be rejected. The domain will be held in this status while the registry waits for the registrar to provide required restoration documentation. If the registrar fails to provide documentation to the registry within 7 calendar days to confirm the restoration request, the domain will revert to REDEMPTIONPERIOD status. The domain status will be set to ACTIVE only if the registrar provides documentation to the registry within 7 calendar days to confirm the restoration request.

PENDINGDELETE: The registry sets this status after a domain has been set in REDEMPTIONPERIOD status and the domain has not been restored by the registrar. The domain will not be included in the zone. Once in this status all registrar requests to modify or otherwise update the domain will be rejected. The domain will be purged from the registry database after being in this status for 5 calendar days.



الأحد، 19 سبتمبر 2010

Adsense Earnings RSS Feed via curl

Adsense Earnings RSS Feed usin curl 

Features

Multiply your income by 10 ! Become a 6 figure blogger ! No, just kidding :) There are no feature this time, except that you can specify how many feed items (i.e. days) you want to have.
<?php
/*
Hack Name: Adsense to RSS 
Version: 1.1
Hack URI: http://planetozh.com/blog/my-projects/track-adsense-earnings-in-rss-feed/
Description: Follow your Adsense earnings with an RSS reader
Author: Ozh
Author URI: http://planetOzh.com
*/

/*
 * Release History
 *
 * 1.1 (04/23/2006 - CGibson)
 * Fixed to work with recent modifications to Google AdSense
 * - Changed "csv" post data field to "outputFormat"
 * - Changed spliting of date from "/" to "-"
 *
 * 1.0 (10/07/2005)
 * Initial Release
*/

/************ SCRIPT CONFIGURATION ***********/
/*********************************************/

$username="you@email.com";
    // your adsense username

$password="MySuPeRpAsSwOrD"; 
    // your adsense password

$daterange = 20 ;
    // range of days to aggregate in RSS reader

$cookie="./.cookiefile";
        // a temp file name - you mostly don't care about this
        // This will create a hidden file in the current directory. If it seems to fail,
        // replace with a full physical path (i.e. /home/you/temp/cookiefile)

/************ DO NOT MODIFY BELOW ************/
/*********************************************/

$daysbefore = mktime(0, 0, 0, date("m") , date("d") - $daterange, date("Y"));
list ($d_from,$m_from,$y_from) = split(':',date("j:n:Y", $daysbefore));
list ($d_to,$m_to,$y_to) = split(':',date("j:n:Y"));


/* Following lines are based on a script found on WMW forums */
/* http://www.webmasterworld.com/forum89/5349.htm */

$destination="/adsense/report/aggregate?"
    ."sortColumn=0"
    ."&reverseSort=false"
    ."&outputFormat=TSV_EXCEL"
    ."&product=afc"
    ."&dateRange.simpleDate=today"
    ."&dateRange.dateRangeType=custom"
    ."&dateRange.customDate.start.day=$d_from"
    ."&dateRange.customDate.start.month=$m_from"
    ."&dateRange.customDate.start.year=$y_from"
    ."&dateRange.customDate.end.day=$d_to"
    ."&dateRange.customDate.end.month=$m_to"
    ."&dateRange.customDate.end.year=$y_to"
    ."&unitPref=page"
    ."&reportType=property"
    ."&searchField="
    ."&groupByPref=date";

$postdata="destination=".urlencode($destination)."&username=".urlencode($username)."&password=".urlencode($password)."&null=Login";

$ch = curl_init(); 
curl_setopt ($ch, CURLOPT_URL,"https://www.google.com/adsense/login.do"); 
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); 
curl_setopt ($ch, CURLOPT_TIMEOUT, 20); 
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION,1); 
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie); 
curl_setopt ($ch, CURLOPT_COOKIEFILE, $cookie); 
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata); 
curl_setopt ($ch, CURLOPT_POST, 1); 
$result = curl_exec ($ch); 
curl_close($ch); 

$result=preg_split("/\n/",$result);
array_pop($result);
array_pop($result);
array_shift($result);
$result = array_reverse($result);

header('Content-type: text/xml');
echo '<?xml version="1.0" encoding="iso-8859-1"?>';
echo "\n";
?>
<rss version="2.0" 
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
>
<channel>
    <title><?php echo "$daterange days of Adsense"; ?></title>
    <link>https://www.google.com/adsense/</link>
    <description>An RSS feed of my Adsense earnings for the last <?php echo $daterange ?> days</description>
    <language>en</language>
<?php

$firstday=1;

foreach ($result as $line) {
    $item = array();
    $line = str_replace("\x00",'',$line);
    $line = str_replace('"','',$line);
    list($day, $pages, $clicks, $ctr, $eCPM, $income) = preg_split("/\s/",$line);
    $item['title']= "<title>\$$income on $day</title>";
    $item['guid'] = '<guid isPermaLink="false">' . md5($username.$day) . "</guid>";
    $day = split('-',$day);
    $day = mktime(0, 0, 0, $day[1] , $day[0], $day[2]);
    if ($firstday == 1) {
        $day = date("D, d M Y H:i:s +0000");
        $firstday = 0;
    } else {
        $day = date("D, d M Y H:i:s +0000", $day);
    }
    $item['pubDate'] = "<pubDate>$day</pubDate>";
    $item['category'] = "<category>adsense</category>";
    $item['description'] = "<description>\$$income ($clicks clicks on $pages pages : CTR = $ctr - eCPM = $eCPM)</description>";
    $item['content'] = "<content:encoded><![CDATA[
    <table>
    <tr><td>Pages printed</td><td>Clicks</td><td>CTR</td><td>eCPM</td><td>Earnings</td></tr>
    <tr><td>$pages</td><td>$clicks</td><td>$ctr</td><td>$eCPM</td><td>$income</td></tr>
    </table>
    ]]></content:encoded>";
    
    print "<item>\n";
    print $item['title'] ."\n";
    print $item['guid'] ."\n";
    print $item['pubDate'] ."\n";
    print $item['category'] ."\n";
    print $item['description'] ."\n";
    print $item['content'] ."\n";
    print "</item>\n";
    
    
}
?>
</channel>
</rss>

السبت، 18 سبتمبر 2010

Submit HTML Form using GET or Post Methods

Submit HTML Form using GET or Post Methods

Form submission in HTML
What is it?
Let uss see in how many steps we take input from user.
  1. The user requests a page using a browser.
  2. The server sends an html markup to the browser. This markup contains a form which has some input fields as discussed earlier.
  3. The user fills up the web-form as he would have done filled up any ordinary physical form.
  4. Now the form is submitted to the server.
  5. The server processes the form and informs the user accordingly.
Pretty clear. No! If you have learnt all the concepts till now, You know which steps are remaining now. The steps 4 and 5. The fifth step is out of scope of this tutorial as it involves some other scripting language.
Talking about step 4.
How is a the form filled up by the user is submitted?
You must have understood by now that all the communication to and from the web-server is done by the browser. So there must be some way to tell the browser that the user is done with the form.
If you remember about the submit button, this button does exactly this thing. When a user has filled up a web-form he clicks on the submit button. When a submit button is clicked, the browser then knows that the form associated with this particular button (As there might be multiple forms on a web-page) is to be submitted to the server. The browser gets the location of the web-server from the action attribute of the associated web-form. Now the browser creates an HTTP request to the server with the values of the form fields. I mean this complete thing, when I think of form submission in HTML.
The browser might create any two of the following HTTP requests depending on yet another attribute "method" of the HTML element "form".
  1. The GET Method
  2. The POST Method.
The major difference between these forms is way the data is transmitted and handled by the browser. This attribute “Method” is specified at the form level. The syntax to specify the method of form submission is as given in the table below.would be
Code
<form action="#" method="GET">
Code
<form action="#" method="POST">
We will now learn one by one about these two methods in detail.

<!--Get Method of form submission-->
The GET method in HTML The GET method is the most commonly used HTTP request type. Actually whenever you enter a simple url in your browser, your browser will make a GET request to the web server. How come? You will become pretty sure of this as you learn what actually is a GET method.
When making an HTTP request by GET method, the browser encodes the form content in the url in the form of name value pairs separated by an ampersand "&". It then appends it to the url specified by the action attribute of the form with a question mark in between the name-value pairs and the url. A typical form submitted by GET method will create a url like “http://www.tutorialindia.com/index.php?userid=john&password=sweet”.
As the url formed while making an HTTP request using a GET method is visible in the address bar, GET method is not recommended for sending sensitive data. Also, as the browser stores the values in the cache, each time the form is submitted, you might not get the desired result. You can learn more about browser caching in the section browser caching. Other hitch in using the get method is that as the maximum length of url is fixed, all the data submitted in the form might not be submitted. To get around this problem, use the post method as discussed in the next section.

The POST method in HTML
In POST method all the form data is encoded as headers. The data is illegible to browser hence it can not cache the form content. Due to this the form is submitted every time the submit button is clicked. Also, You can send as much data as you wish using POST method. With the POST method, the form becomes a black box for the browser. Though it does process the form, it never stores any form value anywhere. This is because it does not know what is inside the box. The browser might store the black box itself temporarily. All the form data is destroyed completely when one closes the browser.
When should one use the GET method and when the POST?
  • Use the GET method if you do not expect the result or effect on server side to change.
  • For the above reason, GET method should be used to fetch static data. For example, one multinational company stores the nationality of its employees in its database. To know the nationality of any specific employee, the GET method is recommended.
  • Use the POST method when you plan to do update, delete or other similar operations on the server side.
  • You can use the POST method for retrieving data also, if you think the input parameters might cross the maximum url length limit. Very unlikely.
  • Other case will be when you do not want the user to bookmark or see the form content being sent. Like in the case of sending the password.
  • Several times you will be using hidden fields in you forms. User might get confused when he sees such a field on the url which he can not relate to the fields available on the screen. To make these fields less visible you can use POST method. POST methods always recommended whenever you do not want the browser to cache the form content.