help with hotmail import contacts script

Discussion in 'PHP' started by 2easyearn, Jan 27, 2008.

  1. #1
    hello,
    i have import contacts script but script work for yahoo but hotmail not work for live

    hotmail.php

    
    <?php
    #Copyright 2006 Svetlozar Petrov
    #All Rights Reserved
    #svetlozar@svetlozar.net
    #http://svetlozar.net
    
    #Script to import the names and emails from hotmail contact list
    
    #Globals Section, $location and $cookiearr should be used in any script that uses
    #                                     get_contacts function
    $location = "";
    $cookiearr = array();
    $chget = null;
    $chpost = null;
    
    #function get_contacts, accepts as arguments $login (the username) and $password
    #returns array of: array of the names and array of the emails if login successful
    #otherwise returns 1 if login is invalid and 2 if username or password was not specified
    function get_contacts($login, $passwd)
    {
      global $location;
      global $cookiearr;
      global $chget;
      global $chpost;
    
      $cookiearr['CkTst']= "G" . time() . "000";
    
      #check if username and password was given:
    	if ((isset($login) && trim($login)=="") || (isset($passwd) && trim($passwd)==""))
    	{
    	  #return error code if they weren't
    		return 2;
    	}
    
      #hotmail requires to add @hotmail.com when you sign in:	
    	if (!eregi("@", $login))
    		$login .= "@" . "hotmail.com";
    
    	#initialize the curl session
    	$chget = curl_init();
    	$chpost = curl_init();
    	
      #get the login form:
    	curl_setopt($chget, CURLOPT_URL,"http://www.hotmail.com");
    	//curl_setopt($chget, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3");
    	curl_setopt($chget, CURLOPT_SSL_VERIFYPEER, 0);
    	curl_setopt($chget, CURLOPT_REFERER, "");
    	curl_setopt($chget, CURLOPT_RETURNTRANSFER,1);
    	curl_setopt($chget, CURLOPT_FOLLOWLOCATION, 1);
    	curl_setopt($chget, CURLOPT_HEADERFUNCTION, 'read_header');
    	$html = curl_exec($chget);
    	
    	#this is not the login form yet, some javascript auto submit form, needs to be submitted before login:
    	$matches = array();
    	preg_match('/<form [^>]+action\="([^"]+)"[^>]*>/', $html, $matches);
    	$opturl = $matches[1];
    	
    	#parse the hidden fields:
    	preg_match_all('/<input type\="hidden"[^>]*name\="([^"]+)"[^>]*value\="([^"]*)">/', $html, $matches);
    	$values = $matches[2];
    	$params = "";
    	
    	$i=0;
    	foreach ($matches[1] as $name)
    	{
    	  $params .= "$name=" . urlencode($values[$i]);
    	  ++$i;
    	  if(isset($matches[$i]))
    	  {
    		$params .= "&";
    	  }
    	}
    	
    	$params = trim ($params, "&");
    	
    	#submit the javascript form:
    	curl_setopt($chpost, CURLOPT_URL, $opturl);
    	curl_setopt($chpost, CURLOPT_FOLLOWLOCATION, 1);
    	curl_setopt($chpost, CURLOPT_RETURNTRANSFER,1);
    	curl_setopt($chpost, CURLOPT_SSL_VERIFYPEER, 0);
      curl_setopt($chpost, CURLOPT_POST, 1);
    	curl_setopt($chpost, CURLOPT_POSTFIELDS, $params);
    	curl_setopt($chpost, CURLOPT_HEADERFUNCTION, 'read_header');
    	$html = curl_exec($chpost);
    
      
      #parse the login form:
    	$matches = array();
    	preg_match('/<form [^>]+action\="([^"]+)"[^>]*>/', $html, $matches);
    	$opturl = $matches[1];
    	
    	
    	#parse the hidden fields:
    	preg_match_all('/<input type="hidden"[^>]*name\="([^"]+)"[^>]*value\="([^"]*)"[^>]*>/', $html, $matches);
    	$values = $matches[2];
    	$params = "";
    		
    	$i=0;
    	foreach ($matches[1] as $name)
    	{
    	  $paramsin[$name]=$values[$i];
    	  ++$i;
    	}
    
      #some form specific javascript stuff before submission, this takes care of that: 
    	$sPad="IfYouAreReadingThisYouHaveTooMuchFreeTime";
    	$lPad=strlen($sPad)-strlen($passwd);
    	$PwPad=substr($sPad, 0,($lPad<0)?0:$lPad);
    	
    	$paramsin['PwdPad']=urlencode($PwPad);
    
    	foreach ($paramsin as $key=>$value)
    	{
    	  $params .= "$key=" . urlencode($value) . "&";
    	}
    
    	curl_setopt($chpost, CURLOPT_URL,$opturl);
    	curl_setopt($chpost, CURLOPT_RETURNTRANSFER,1);
    	curl_setopt($chpost, CURLOPT_FOLLOWLOCATION, 1);
    	curl_setopt($chpost, CURLOPT_POST, 1);
    	curl_setopt($chpost, CURLOPT_POSTFIELDS, $params . "login=" . urlencode($login) . "&passwd=" . urlencode($passwd) . "&LoginOptions=3");
    	$html = curl_exec($chpost);
    	
      #test for valid login:
    	if((preg_match('/replace[^"]*"([^"]*)"/', $html, $matches)==0) && (preg_match("/url=([^\"]*)\"/si", $html, $matches)==0 || eregi("password is incorrect", $html)))
    	{
      	return 1;
    	}
    	
      
      #curl_setopt($chget, CURLOPT_URL, $location);
    	curl_setopt($chget, CURLOPT_URL,$matches[1]);
    	curl_setopt($chget, CURLOPT_RETURNTRANSFER,1);
    	curl_setopt($chget, CURLOPT_FOLLOWLOCATION, 1);
    	curl_setopt($chget, CURLOPT_HEADERFUNCTION, 'read_header');
    	
    	$html = curl_exec($chget);
    	
    	if (eregi("hotmail.msn.com/", $location))
    	{
        #process the non-live interface
          #passed the login, you need to load this page to get some more cookies to complete the login
        	curl_setopt($chget, CURLOPT_URL,"http://cb1.msn.com/hm/header.armx?lid=1033&cbpage=login&lc=1033&x=3.200.4104.0");
        	curl_setopt($chget, CURLOPT_RETURNTRANSFER,1);
        	curl_setopt($chget, CURLOPT_FOLLOWLOCATION, 1);
        	curl_setopt($chget, CURLOPT_HEADERFUNCTION, 'read_header');
        	$html = curl_exec($chget);
        
          #follow the javascript redirection url:
        	curl_setopt($chget, CURLOPT_POST, 0);
        	curl_setopt($chget, CURLOPT_URL,$matches[1]);
        	curl_setopt($chget, CURLOPT_RETURNTRANSFER,1);
        	curl_setopt($chget, CURLOPT_FOLLOWLOCATION, 0);
        	curl_setopt($chget, CURLOPT_HEADERFUNCTION, 'read_header');
        	
        	$html = curl_exec($chget);
        	
          #get the base url and build the url for the page with contacts:
        	preg_match("/(http:\/\/[^\/]*\/cgi-bin\/).*?curmbox=([^\& ]*).*?a=([^\& ]*)/i", $location, $baseurl);
        	$url = $baseurl[1] . "AddressPicker?a=$baseurl[3]&curmbox=$baseurl[2]&Context=InsertAddress&_HMaction=Edit&qF=to";	
        	
        	curl_setopt($chget, CURLOPT_URL,$url);
        	curl_setopt($chget, CURLOPT_USERAGENT, 0);
        	curl_setopt($chget, CURLOPT_RETURNTRANSFER,1);
        	curl_setopt($chget, CURLOPT_FOLLOWLOCATION, 1);
        	curl_setopt($chget, CURLOPT_HEADERFUNCTION, 'read_header');
        	
        	$html = curl_exec($chget);
        
          #parse the emails and names:
        	preg_match_all('/<option.*?value="([^"]*)"[^>]*>(.*?)\&lt;/i', $html, $emailarr);
        	
        
          #get rid of duplicates:
        	$emailsunique = array_unique($emailarr[1]);
        
          $i = 0;
        	foreach ($emailsunique as $key => $value)
        	{
            $emails[$i] = $emailarr[1][$key];
            $names[$i++] = $emailarr[2][$key];
          }
        
          #return the result:
          return array($names, $emails);
      }
    
      preg_match('/replace[^"]*"([^"]*)"/', $html, $matches);
     	curl_setopt($chget, CURLOPT_URL,$matches[1]);
    	curl_setopt($chget, CURLOPT_RETURNTRANSFER,1);
    	curl_setopt($chget, CURLOPT_FOLLOWLOCATION, 1);
    	curl_setopt($chget, CURLOPT_HEADERFUNCTION, 'read_header');
    	
    	$html = curl_exec($chget);
    	
    
    	$matches = array();
    	preg_match('/<form [^>]+action\="([^"]+)"[^>]*>/', $html, $matches);
    	$opturl = $matches[1];
    	
    	#parse the hidden fields:
    	preg_match_all('/<input type\="hidden"[^>]*name\="([^"]+)"[^>]*value\="([^"]*)">/', $html, $matches);
    	$values = $matches[2];
    	$params = "";
    	
    	$i=0;
    	foreach ($matches[1] as $name)
    	{
    	  $params .= "$name=" . urlencode($values[$i]);
    	  ++$i;
    	  if(isset($matches[$i]))
    	  {
    		$params .= "&";
    	  }
    	}
    	
    	$params = trim ($params, "&");
    	
    	#submit the javascript form:
    	curl_setopt($chpost, CURLOPT_URL, $opturl);
    	curl_setopt($chpost, CURLOPT_FOLLOWLOCATION, 1);
    	curl_setopt($chpost, CURLOPT_RETURNTRANSFER,1);
    	curl_setopt($chpost, CURLOPT_SSL_VERIFYPEER, 0);
      curl_setopt($chpost, CURLOPT_POST, 1);
    	curl_setopt($chpost, CURLOPT_POSTFIELDS, $params);
    	curl_setopt($chpost, CURLOPT_HEADERFUNCTION, 'read_header');
    	$html = curl_exec($chpost);
    	
     
      $url = $location;
      $url = explode("/", $location);
      $url[count($url)-1] = "ApplicationMainReach.aspx?Control=EditMessage&FolderID=00000000-0000-0000-0000-000000000001";//$matches[1];
      $url = implode("/", $url);
    
    	curl_setopt($chget, CURLOPT_URL,$url);
    	curl_setopt($chget, CURLOPT_RETURNTRANSFER,1);
    	curl_setopt($chget, CURLOPT_FOLLOWLOCATION, 1);
    	curl_setopt($chget, CURLOPT_HEADERFUNCTION, 'read_header');
    	
    	$html = curl_exec($chget);
    
    	preg_match_all('/<input.*?type\="?hidden"?.*?name\="([^"]*)".*?value\="([^"]*)"/si', $html, $matches);
      $postarr[$matches[1][0]]=($matches[2][0]);
      $postarr["query"]= "Find in Mail";
      $postarr["ToContact"]= "To:";
      $postarr["fTo"]= "";
      $postarr["fCC"]= "";
      $postarr["fBcc"]= "";
      $postarr["fSubject"]= "";
      $postarr["fMessageBody"]= "";
      
      curl_setopt($chpost, CURLOPT_URL, $url);
    	curl_setopt($chpost, CURLOPT_FOLLOWLOCATION, 1);
    	curl_setopt($chpost, CURLOPT_RETURNTRANSFER,1);
    	curl_setopt($chpost, CURLOPT_SSL_VERIFYPEER, 0);
      curl_setopt($chpost, CURLOPT_POST, 1);
    	curl_setopt($chpost, CURLOPT_POSTFIELDS, $postarr);
    	curl_setopt($chpost, CURLOPT_HEADERFUNCTION, 'read_header');
    	$html = curl_exec($chpost);
    
    	preg_match_all('/<input type="checkbox" name="contactNameEmail" value="([^;]*);([^"]+)"/si', $html, $matches);
    	
    	$emails = array_map("arrurldecode", $matches[2]);
      $names = array_map("arrurldecode", $matches[1]);
    
      return array($names, $emails);
    }
    
    function arrurldecode($val)
    {
      return urldecode ($val);
    }
    
    #read_header is essential as it processes all cookies and keeps track of the current location url
    #leave unchanged, include it with get_contacts
    function read_header($ch, $string)
    {
        global $location;
        global $cookiearr;
        global $chget;
        global $chpost;
        
        $length = strlen($string);
        if(!strncmp($string, "Location:", 9))
        {
          $location = trim(substr($string, 9, -1));
        }
        if(!strncmp($string, "Set-Cookie:", 11))
        {
          $cookiestr = trim(substr($string, 11, -1));
          $cookie = explode(';', $cookiestr);
          $cookie = explode('=', $cookie[0]);
          $cookiename = trim(array_shift($cookie)); 
          $cookiearr[$cookiename] = trim(implode('=', $cookie));
        }
        $cookie = "";
        if(trim($string) == "") 
        {
          foreach ($cookiearr as $key=>$value)
          {
            $cookie .= "$key=$value; ";
          }
          $cookie = trim ($cookie, "; ");
          curl_setopt($chget, CURLOPT_COOKIE, $cookie);
          curl_setopt($chpost, CURLOPT_COOKIE, $cookie);
        }
    
        return $length;
    }
    
    ?>
    
    PHP:
    anyone can help me to edit this file to work for live
     
    2easyearn, Jan 27, 2008 IP
  2. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #2
    I doubt anyone will debug and edit that entire script for free. You'd be better off paying someone, or offering an incentive.

    Jay
     
    jayshah, Jan 27, 2008 IP
  3. 2easyearn

    2easyearn Guest

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    its simple edit just exchange hotmail links to live links coz hotmail server redirect to live.com so script didn't work
     
    2easyearn, Jan 27, 2008 IP
  4. Upeksha

    Upeksha Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi,
    Hope this would help.

    
    <?php
    /*
    This class connects to the MSNM service and returns
    all the email addresses and screen names in the contact
    list of the supplied user.
    
    This is a derivation of a more general purpose php class
    available at http://flumpcakes.co.uk/php/msn-messenger.
    
    Unlike the more general purpose class, which can handle
    sending and receiving messages, this class solely connects
    and the retrieves the contact list.
    
    */
    
    class hotmail
    {
    	// messenger.hotmail.com is an exchange server
    	// using it will redirect to a server with an open slot
    	// using a known server ip will help connect faster
    
    	// commenting out $ssh_login will mean the url to the
    	// secure login server will be taken from a secure
    	// session.  this will slow down connecting a bit.
    	// Note: comment out $ssh_login if you experience auth failures
    
    	var $server	=	'messenger.hotmail.com';
    	var $port	=	1863;
    
    	var $nexus	=	'https://nexus.passport.com/rdr/pprdr.asp';
    	var $ssh_login	=	'login.live.com/login2.srf';
    
    	var $debug	=	0;
    
    	var $curl_bin	=	0;
    	var $curl	=	'/usr/bin/curl';	// linux
    //	var $curl	=	'D:/curl/curl.exe';		// windows
    
        //Used to prevent the script from hanging
        var $count = 0;
    
        //Used to store the email addresses until all have been collected
        var $email_input = array();
        var $email_processing = array();
        var $email_output = array();
    
    	/**
    	 *
    	 * desc	:	Connect to MSN Messenger Network
    	 *
    	 * in	:	$passport	=	passport i.e: user@hotmail.com
    	 *		$password	=	password for passport
    	 *
    	 * out	:	true on success else return false
    	 *
    	 */
    
    	function connect($passport, $password)
    	{
    		$this->trID = 1;
    
    		if (!$this->fp = @fsockopen($this->server, $this->port, $errno, $errstr, 2)) {
    
                die("Could not connect to messenger service");
    		}else {
    		      stream_set_timeout($this->fp, 2);
    
    			$this->_put("VER $this->trID MSNP9 CVR0\r\n");
    
    			while (! feof($this->fp))
    			{
    				$data = $this->_get();
    
    				switch ($code = substr($data, 0, 3))
    				{
    					default:
    						echo $this->_get_error($code);
    
    						return false;
    					break;
    					case 'VER':
    						$this->_put("CVR $this->trID 0x0409 win 4.10 i386 MSNMSGR 7.0.0816 MSMSGS $passport\r\n");
    					break;
    					case 'CVR':
    						$this->_put("USR $this->trID TWN I $passport\r\n");
    					break;
    					case 'XFR':
    						list(, , , $ip)  = explode (' ', $data);
    						list($ip, $port) = explode (':', $ip);
    
    						if ($this->fp = @fsockopen($ip, $port, $errno, $errstr, 2))
    						{
    							$this->trID = 1;
    
    							$this->_put("VER $this->trID MSNP9 CVR0\r\n");
    						}
    						else
    						{
    							if (! empty($this->debug)) echo 'Unable to connect to msn server (transfer)';
    
    							return false;
    						}
    					break;
    					case 'USR':
    						if (isset($this->authed))
    						{
    							return true;
    						}
    						else
    						{
    							$this->passport = $passport;
    							$this->password = urlencode($password);
    
    							list(,,,, $code) = explode(' ', trim($data));
    
    							if ($auth = $this->_ssl_auth($code))
    							{
    								$this->_put("USR $this->trID TWN S $auth\r\n");
    
    								$this->authed = 1;
    							}
    							else
    							{
    								if (! empty($this->debug)) echo 'auth failed';
    
    								return false;
    							}
    						}
    					break;
    				}
    			}
    		}
    
    	}
    
        //Collects the raw data containing the email addresses
    	function rx_data()
    	{
    		$this->_put("SYN $this->trID 0\r\n");
    
    		//Supplies the second MSG code which stops
    		//the script from hanging as it waits for
    		//more content
    		$this->_put("CHG $this->trID NLN\r\n");
    
            $stream_info = stream_get_meta_data($this->fp);
            $email_total = 100;
            //the count check prevents the script hanging as it waits for more content
    		while ((! feof($this->fp)) && (! $stream_info['timed_out']) && ($this->count <= 1) && (count($this->email_input) < $email_total))
    		{
    			$data = $this->_get();
    			$stream_info = stream_get_meta_data($this->fp);
    
    			if ($data)
    			{
    
    			    switch($code = substr($data, 0, 3))
    				{
    					default:
    						// uncommenting this line here would probably give a load of "error code not found" messages.
    						//echo $this->_get_error($code);
    					break;
    					case 'MSG':
    					   //This prevents the script hanging as it waits for more content
    					   $this->count++;
    					break;
    					case 'LST':
    					   //These are the email addresses
    					   //They need to be collected in email_input
    
    					   $this->email_input[] = $data;
    					   if ($this->debug) print("<span class='b'>" . count($this->email_input) . "</span>");
    
    					break;
    					case 'SYN':
    					$syn_explode = explode(" ", $data);
    					$email_total = $syn_explode[3];
    					break;
    					case 'CHL':
    						$bits = explode (' ', trim($data));
    
    						$return = md5($bits[2].'Q1P7W2E4J9R8U3S5');
    						$this->_put("QRY $this->trID msmsgs@msnmsgr.com 32\r\n$return");
    					break;
    
    				}
    			}
    		}
    
    	}
    	 function getAddressbook($username, $password)
                   {
                        $returned_emails=$this->qGrab($username, $password);
    
    				foreach($returned_emails as $row){
    				//$totalRecords=$totalRecords+1;
    				//print("<tr><td style='Font-Family:verdana;Font-Size:14'>$row[1]</td><td style='Font-Family:verdana;Font-Size:14'>$row[0]</td></tr>");
    
                                     $result['name'][]=$row[1];
                                     $result['email'][]=$row[0];
    				}
    
                         return $result;
    
                   }
    	//This function extracts the emails and screen names from the raw data
    	//collected by rx_data
    	function process_emails () {
    
          //Neaten up the emails
    
          //$regex = "|^LST\s(\S+?)\s(\S+?)\s\d+?\s\d+?$|";
          foreach($this->email_input as $email_entry) {
    
            //Seperate out the email from the name and other data
            $this->email_processing[] = explode(" ", $email_entry);
    
          }
    
          //Get rid of the unnecessary data and clean up the name
          foreach($this->email_processing as $email_entry){
    
            $this->email_output[] = array(0 => $email_entry['1'],
                                            1 => urldecode($email_entry[2]));
        }
    
        //var_dump($this->email_processing);
        //var_dump($this->email_output);
    
    
    
      }
    
        //This is a quick way of calling all the seperate functions
        //needed to grab the contact list
        function qGrab ($username, $password) {
    
          //Connect to the MSNM service
          $this->connect($username, $password);
    
          //Get data
          $this->rx_data();
    
          //Process emails
          $this->process_emails();
    
          //send the email array
          return $this->email_output;
    
    
        }
    
    
    	/*====================================*\
    		Various private functions
    	\*====================================*/
    
    	function _ssl_auth($auth_string)
    	{
    		if (empty($this->ssh_login))
    		{
    			if ($this->curl_bin)
    			{
    				exec("$this->curl -m 60 -LkI $this->nexus", $header);
    				$header = implode($header, null);
    			}
    			else
    			{
    				$ch = curl_init($this->nexus);
    
    				curl_setopt($ch, CURLOPT_HEADER, 1);
    				curl_setopt($ch, CURLOPT_NOBODY, 1);
    				curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    				curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    				curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    				// curl_setopt($ch, CURLOPT_TIMEOUT, 2);
    
    				$header = curl_exec($ch);
    
    				curl_close($ch);
    			}
    
    			preg_match ('/DALogin=(.*?),/', $header, $out);
    
    			if (isset($out[1]))
    			{
    				$slogin = $out[1];
    			}
    			else
    			{
    				return false;
    			}
    		}
    		else
    		{
    			$slogin = $this->ssh_login;
    		}
    
    
    		if ($this->curl_bin)
    		{
    			$header1 = '"Authorization: Passport1.4 OrgVerb=GET,OrgURL=http%3A%2F%2Fmessenger%2Emsn%2Ecom,sign-in='.$this->passport.',pwd='.$this->password.','.$auth_string.'"';
    
    			exec("$this->curl -m 60 -LkI -H $header1 https://$slogin", $auth_string);
    
    			$header = null;
    
    			foreach ($auth_string as $key => $value)
    			{
    				if (strstr($value, 'Unauthorized'))
    				{
    					echo 'Unauthorised';
    					return false;
    				}
    				elseif (strstr($value, 'Authentication-Info'))
    				{
    					$header = $value;
    				}
    			}
    		}
    		else
    		{
    			$ch = curl_init('https://'.$slogin);
    			curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    							'Authorization: Passport1.4 OrgVerb=GET,OrgURL=http%3A%2F%2Fmessenger%2Emsn%2Ecom,sign-in='.$this->passport.',pwd='.$this->password.','.$auth_string,
    							'Host: login.passport.com'
    							));
    
    			curl_setopt($ch, CURLOPT_HEADER, 1);
    			curl_setopt($ch, CURLOPT_NOBODY, 1);
    			curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    			curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    			// curl_setopt($ch, CURLOPT_TIMEOUT, 2);
    
    			$header = curl_exec($ch);
    
    			curl_close($ch);
    		}
    
    		preg_match ("/from-PP='(.*?)'/", $header, $out);
    
    		return (isset($out[1])) ? $out[1] : false;
    	}
    
    
    	function _get()
    	{
    		if ($data = @fgets($this->fp, 4096))
    		{
    
    
    			if ($this->debug) echo "<div class=\"r\">&lt;&lt;&lt; $data</div>\n";
    
    			return $data;
    		}
    		else
    		{
    			return false;
    		}
    	}
    
    
    	function _put($data)
    	{
    		fwrite($this->fp, $data);
    
    		$this->trID++;
    
    		if ($this->debug) echo "<div class=\"g\">&gt;&gt;&gt; $data</div>";
    	}
    
    
    	function _get_error($code)
    	{
    		switch ($code)
    		{
    			case 201:
    				return 'Error: 201 Invalid parameter';
    			break;
    			case 217:
    				return 'Error: 217 Principal not on-line';
    			break;
    			case 500:
    				return 'Error: 500 Internal server error';
    			break;
    			case 540:
    				return 'Error: 540 Challenge response failed';
    			break;
    			case 601:
    				return 'Error: 601 Server is unavailable';
    			break;
    			case 710:
    				return 'Error: 710 Bad CVR parameters sent';
    			break;
    			case 713:
    				return 'Error: 713 Calling too rapidly';
    			break;
    			case 731:
    				return 'Error: 731 Not expected';
    			break;
    			case 800:
    				return 'Error: 800 Changing too rapidly';
    			break;
    			case 910:
    			case 921:
    				return 'Error: 910/921 Server too busy';
    			break;
    			case 911:
    				return 'Error: 911 Authentication failed';
    			break;
    			case 923:
    				return 'Error: 923 Kids Passport without parental consent';
    			break;
    			case 928:
    				return 'Error: 928 Bad ticket';
    			break;
    			default:
    				return 'Error code '.$code.' not found';
    			break;
    		}
    	}
    
    
    
    
    }
    
    ?>
    
    PHP:

    pass the passport amending hotmail.com eg: username@hotmail.com

    have fun! :)
     
    Upeksha, Nov 17, 2008 IP
  5. Bipin Prajapati

    Bipin Prajapati Greenhorn

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #5
    I tried the above code but i was not able to get my contacts list. It returns error.
     
    Bipin Prajapati, Sep 10, 2013 IP
  6. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #6
    Whow Bipin Prajapati, you give so much information that my head is spinning!!!!

    It returns a error? yes? and what for error? when? you can understand that nobody can help you if you don't provice sufficient information!!!
     
    EricBruggema, Sep 11, 2013 IP
  7. Bipin Prajapati

    Bipin Prajapati Greenhorn

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #7
    It returns 'Error code not found'. What should i need to do for getting the hotmail contacts.
     
    Bipin Prajapati, Sep 12, 2013 IP