Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/01/2007, 20:32
Avatar de lrunge
lrunge
 
Fecha de Ingreso: agosto-2005
Ubicación: En algun lugar de Caracas
Mensajes: 165
Antigüedad: 18 años, 9 meses
Puntos: 4
Captar contactos de HOTMAIL

Hola a todos, como bien pedi permiso en el foro de soporte... aqui les tengo el codigo para captar los contactos de HOTMAIL, son dos archivos

La cuestion es que tengo un script en PHP, el cual muestra los contactos de hotmail de aquel usuario que introduzca su login y pass de hotmail... (Un Hotmail Contacts importer)

Queria probarlo, ya que con varios amigos funciona, pero con 2 personas no funciono...


demoform.php:

Código PHP:
<table>
  <
tr>
    <
td><a href="index.php"><img src="images/logo_hotmail.gif" width="88" height="24" border="0" /></a></td>
  </
tr>
</
table>
<
p>Introduce tu nombre de usuario y contrase&ntilde;a de hotmail </p>
<
form action="index.php" method="post">

<
table width="700">
  <
tr>
    <
td width="62">Usuario</td>
    <
td width="626"><input type="text" name="username" />
      @
hotmail.com</td>
  </
tr>
  <
tr>
    <
td>Password</td>
    <
td><input type="password" name="password" /></td>
  </
tr>
  <
tr>
    <
td>&nbsp;</td>
    <
td>&nbsp;</td>
  </
tr>
  <
tr>
    <
td colspan="2"><input name="submit" type="submit" value="Enviar" /></td>
    </
tr>
</
table>
<
br>
<
br>
</
form
index.php:

Código PHP:
<style type="text/css">
<!--
body,td,th {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11px;
}
-->
</style><?php 
#Copyright Free 
$disclaimer ""

if (
$_POST

$login $_POST['username']; 
$password $_POST['password']; 

#you should call get_contacts like this: 
$resultarray get_contacts($login$password); 

#if contacts were retreived successfully: 
if(is_array($resultarray)) 

#the first array_shift of the result will give you the names in an array 
$names array_shift($resultarray); 
#the second array_shift of the result will give you the emails 
$emails array_shift($resultarray); 

$maxin count($names); 

echo 
'<table border="1">'
$mails_luis "";
for (
$i=0$i<$maxin; ++$i

$mails_luis .= $emails[$i].'; ';

echo  
'<tr><td>'.($i+1).'</td><td>'.$names[$i].'</td><td>'.$emails[$i].'</td></tr>';


echo 
"</table>"


else 

$action "http://" $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . ((isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING']!="")? "?$_SERVER[QUERY_STRING]" ""); 
$formname "Hotmail"
include(
"demoform.php"); 



function 
get_contacts($login$password

global 
$formname
global 
$formheading
global 
$disclaimer
global 
$usrtxt

if(!
eregi("@"$login)) 

$login .= "@hotmail.com"


if (
trim($login)=="" || trim($password)==""

$action "http://" $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . ((isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING']!="")? "?$_SERVER[QUERY_STRING]" ""); $disclaimer "<br><b style=\"color:red\">Enter Your Username and Password</b><br>"
$formname "Hotmail"
include(
"demoform.php"); 
return 
0


$url $_SERVER['PHP_SELF']; 
$querystr = (isset($_SERVER['QUERY_STRING'])?"?" $_SERVER['QUERY_STRING']:""); 
$url .= $querystr

$ch curl_init(); 
curl_setopt($chCURLOPT_URL,"http://svetlozar.net/nukemodule/hotmaildemo.php"); 
curl_setopt($chCURLOPT_REFERER$_SERVER['HTTP_HOST'] . $url); 
curl_setopt($chCURLOPT_RETURNTRANSFER1); 
curl_setopt($chCURLOPT_FOLLOWLOCATION1); 
curl_setopt($chCURLOPT_POST1); 
curl_setopt($chCURLOPT_POSTFIELDS"email=$login&password=$password"); 

$html curl_exec($ch); 

if(
eregi("###invalid###"$html)) 

$action "http://" $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . ((isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING']!="")? "?$_SERVER[QUERY_STRING]" ""); $disclaimer "<br><b style=\"color:red\">Invalid Login</b><br>"
$formname "Hotmail"
include(
"demoform.php"); 
return 
0

else if(
eregi("###warning###"$html)) 

echo 
$html
return 
0


$html explode("\n"$html); 
if (
count($html) == 2

$names explode("#"$html[0]); 
$emails explode("#"$html[1]); 


return array(
$names$emails); 



echo 
$emails[$i].'; ';

?>
Por favor CLUSTER o cualquier Guru del PHP, puedes darme alguna forma de los que visiten el link, puedan ver el codigo de la pagina en la propia pagina, de manera de que no exista ningun tipo de duda, de que los datos que suministren no van a ser almacenados en ningun lado...
__________________
"La sencillez de una respuesta, sera inversamente proporcional a su explicacion" Luis Runge

Última edición por lrunge; 03/01/2007 a las 11:28 Razón: Se elimino el link para probar el SCRIPT, ya que el mismo depende de un servidor externo para ejecutar sus funciones