İyinet'e Hoşgeldiniz!

Türkiye'nin En Eski Webmaster Forum'una Hemen Kayıt Olun!

Kayıt Ol!

hotmail.php

timsah

0
İyinet Üyesi
Katılım
2 Kasım 2005
Mesajlar
447
Reaction score
0
Konum
İZMİR
Sitemde tavsiye sistemi var ornek herhangi bir uye msnindeki tum listesine davetiye gonderebiliyor, scriptin icinde hazirdi ama calstiramadim hata vermiyor fakat surekli, tekrar deneyin diyor scriptin icindeki hotmail.php kodlari verimsiz kaliyor hata nerde acaba cozemedim. yardimci olursaniz sevinirim







HTML:
<?
//---------**** Functions required to run index.php****------------//
mt_srand((double)microtime()*100000);
$test=mt_rand(65,90);
$test3=mt_rand(97,122);
$test1=mt_rand(65,90);
$test4=mt_rand(48,57);
$test5=mt_rand(48,57);
$test6=mt_rand(65,90);
$test7=mt_rand(97,122);
$test8=mt_rand(97,122);
$ram1=chr($test);
$ram2=chr($test3);
$ram3=chr($test4);
$ram4=chr($test1);
$ram5=chr($test5);
$ram6=chr($test6);
$ram7=chr($test7);
$ram8=chr($test8);
$fname="$ram1$ram2$ram3$ram4$ram5"; ///Random string for unique file name
function login($hotmail_user_id,$hotmail_user_password)
{
 global $cookie_file_path,$acurmbox,$str,$fname;
 $file="./$fname".".txt";
 @unlink($file);
 // 1-Get First Login Page http://www.hotmail.com
 // This page will set some cookies and later we will use these cookies to access inside pages .
 $cookie_file_path ="../temp/".$fname.".txt";  // Please set your cookie domain
 $LOGINURL = "http://www.hotmail.com";
        $result = get_curl($LOGINURL,$cookie_file_path,"","");
 $action=substr($result,strpos($result,'action="')+strlen("action=\""));
 $action1=substr($action,0,strpos($action,'"'));
  $value=substr($result,strpos($result,'value="')+strlen("value=\""));
 $value=substr($value,0,strpos($value,'"'));
 $POSTFIELDS = 'mspppostint='.urlencode($value);
 $result= get_curl($action1,$cookie_file_path,$POSTFIELDS,"http://www.hotmail.com");  
 $action=substr($result,strpos($result,'action="')+strlen("action=\""));
 $action=substr($action,0,strpos($action,'"'));
 $value=substr($result,strpos($result,'id="i0327" value="')+strlen("id=\"i0327\" value=\""));
 $value=substr($value,0,strpos($value,'"'));
        $RsPass = (get_magic_quotes_gpc()) ? stripslashes($hotmail_user_password) : $hotmail_user_password;
        $RsLogin = (get_magic_quotes_gpc()) ? stripslashes($hotmail_user_id) : $hotmail_user_id;
 $POSTFIELDS = "PPFT=$value&PPSX=Passport&PwdPad=&LoginOptions=3&notinframe=1&SI=    Sign In    &passwd=".urlencode($RsPass)."&login=".urlencode($RsLogin);
    $reffer = $action1;
 // 2- Post Login Data to Page https://login.passport.com/ppsecure/post.srf.... to login to hotmail
 $str= get_curl($action,$cookie_file_path,$POSTFIELDS,$reffer); 
//echo htmlspecialchars($str);
 $str1=substr($str,strpos($str,"http://"));
 $str2=substr($str1,0,strpos($str1,"\");"));
    $result = get_curl($str2,$cookie_file_path,"","");
 //write_to_file($str);
 if(strpos($result,"curmbox")===false)
 return false;
//Get 'curmbox' and 'a' variable's value from a page's source code
///and embed those value at the end of a url
 $str1=substr($result,strpos($result,"curmbox"));
 $str1=$acurmbox=substr($str1,0,strpos($str1,"\""));
 if($str1=="")
 $invalid=true;
 if(isset($invalid))
 return false;
 else
 return true;
}
function get_address_page()
{ 
 global $cookie_file_path,$acurmbox,$prarray,$emarray;
 $additional_parameter=$acurmbox;
 ///Address page url 
 $str="http://by16fd.bay16.hotmail.msn.com/cgi-bin/addresses?&$additional_parameter";
 //Address page's print preview page url
 $prview="http://by16fd.bay16.hotmail.msn.com/cgi-bin/addresses?&$additional_parameter&strUsrFltr=&strUsrView=&strAlphNav=&PrintView=1";
     ///Get the print preview page and save Name and password in temp array
 $prvstr=get_curl($prview,$cookie_file_path,"","");
 $tbst='<table border=0 cellpadding=0 cellspacing=0 width=100% class="Contact">';
 $table=substr($prvstr,strpos($prvstr,$tbst));
 $table=substr($table,0,strpos($table,"</table>"));
 //echo $table;
 $rows=explode("<tr>",$table);
 //echo sizeof($rows);
 $emarray=array();
 $nmarray=array();
 for($i=2;$i<sizeof($rows);$i++)
 {
 $colums=explode("</td>",$rows[$i]);
 $emarray[]=strip_tags(substr($colums[1],0,strpos($colums[1],'</span>')));
 }
 //Get the address page and return contents of address page
 $str=get_curl($str,$cookie_file_path,"","");
 return $str;
}
function get_curl($url,$cookie_path="",$postfileds="",$referrer="")
{
 $agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)";
    $ch = curl_init(); 
    curl_setopt($ch, CURLOPT_URL,$url);
 curl_setopt($ch, CURLOPT_USERAGENT, $agent);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
 if($referrer!="") 
  curl_setopt($ch, CURLOPT_REFERER, $referrer);
 if($cookie_path!="")
  {
   curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_path);
   curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_path);
  }
 if($postfileds!="")
     {
  curl_setopt($ch, CURLOPT_POST, 1); 
  curl_setopt($ch, CURLOPT_POSTFIELDS,$postfileds); 
  }
 $result = curl_exec ($ch);
 curl_close ($ch);
 return $result;
}
function parser($str)
{
 global $id_str,$id_array,$name_array,$email_array,$phone_array,$call_more,$call_array,$cookie_file_path;
 ///get the table body which containing email address and names
 $a='<table border=0 cellpadding=0 cellspacing=0 width=100% class="EE" id="ListTable">';
 $b="<td colspan=5> </td>";
 $str=substr($str,strpos($str,$a));
 $str=substr($str,0,strpos($str,$b)+strlen($b));
 ///Parse the html data and bring out name and addresses
 $rows=explode("</tr>",$str);
 for($i=2;$i<sizeof($rows);$i++)
  {
    $tr_name=substr($rows[$i],strlen("<tr name='"));
    $tr_name=substr($tr_name,0,strpos($tr_name,"'"));
  $rows[$i]=substr($rows[$i],strpos("$rows[$i]","<td")-1);
  $colums=explode("</td>",$rows[$i]);
  $call_more=false;
   for($j=0;$j<sizeof($colums);$j++)
   {
   if(sizeof($colums)==6)
    {
    switch($j)
     {
     case 0:
     $id_str=substr($colums[$j],strpos($colums[$j],"name=")+6);
     $id_str=$id_array[]=substr($id_str,0,strpos($id_str,"\""));
     break;
     case 2:
     $name_str=substr($colums[$j],strpos($colums[$j],"return false;\">")+strlen("return false;\">"));
     $name_str=$name_array[]=substr($name_str,0,strpos($name_str,"</a>"));
     break;
     case 3:
     $email_str=substr($colums[$j],strpos($colums[$j],"return false;\">")+strlen("return false;\">"));
     $email_str=substr($email_str,0,strpos($email_str,"</a>"));
     if(!ereg("^[^@ ]+@[^@ ]+\.[^@ \.]+$",$email_str))
      $email_array[]=$tr_name;
     else
      $email_array[]=$email_str;
     if(strpos($colums[$j],"more"))
     $call_more=true;
     break;
     default:
     break;
     }
    }
    else
    {
    switch($j)
     {
     case 0:
     $id_str=substr($colums[$j],strpos($colums[$j],"name=")+6);
     $id_str=$id_array[]=substr($id_str,0,strpos($id_str,"\""));
     break;
     case 3:
     $name_str=substr($colums[$j],strpos($colums[$j],"return false;\">")+strlen("return false;\">"));
     $name_str=$name_array[]=substr($name_str,0,strpos($name_str,"</a>"));
     break;
     case 4:
     $email_str=substr($colums[$j],strpos($colums[$j],"return false;\">")+strlen("return false;\">"));
     $email_str=substr($email_str,0,strpos($email_str,"</a>"));
     if(!ereg("^[^@ ]+@[^@ ]+\.[^@ \.]+$",$email_str))
      $email_array[]=$tr_name;
     else
      $email_array[]=$email_str;
     if(strpos($colums[$j],"more"))
     $call_more=true;
     break;
     default:
     break;
     }
    }
   }
 }
@unlink($cookie_file_path);
}
?>
 

TRinsanRehberi

0
İyinet Üyesi
Katılım
21 Ağustos 2005
Mesajlar
1,845
Reaction score
0
//---------**** Functions required to run index.php****------------//

en başında bu yazıyor

fonksiyonlar index.php nin çalıştırılmasını gerektiriyor diyor.

yani bir tane index.php dosyası olmalı ve siz bu kodu çalıştırmadan önce onu çalıştırmış olmalısın gibi bir yorum var.

kodu alıp kendi makinamda çalıştıracaktım select yapmak için kodun en başına gittim
bu ifadeyi görünce seçip kendimdeki bir dosyaya kopyalayıp hatayı aramaktan vazgeçtim.

bu ilk cümleyi dikkate alın derim ben.
 

Türkiye’nin ilk webmaster forum sitesi iyinet.com'da forum üyeleri tarafından yapılan tüm paylaşımlardan; Türk Ceza Kanunu’nun 20. Maddesinin, 5651 Sayılı Kanununun 4. maddesinin 2. fıkrasına göre, paylaşım yapan üyeler sorumludur.

Üst