elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.


Tema destacado: Recopilación Tutoriales y Manuales Hacking, Seguridad, Privacidad, Hardware, etc


  Mostrar Temas
Páginas: 1 [2]
11  Programación / PHP / imap con php en: 21 Julio 2011, 03:04 am
anteriormente me conectaba con este code por imap
Código:
<?php 
if($mbox = @imap_open("{imap.gmail.com:993/imap/ssl}", "user", "passw", OP_HALFOPEN)) 
{
    echo "Ingresaste con exito ";
}
else
 {
    echo "error";
}
?>
pero lo probe tiempo despues en un hosting y siempe me dice error y no me puedo conectar, no se si sea el hosting ya que cuando veo en phpinfo sale esto de imap
IMAP c-Client Version 2007e
SSL Support enabled
Kerberos Support enabled
se supone que esta instalado entonces no entiendo el error
12  Programación / PHP / login curl en: 10 Julio 2011, 23:09 pm
intento logearme en una web mediante curl pero el problema es que siempre me dice que mi sesion a caducado, alparecer si se envia el ususario y la contraseña.
por ejemplo tengo:
formulario.html
login.php
panel.php

entonces realizo esto

$pd = "user=user&password=password";
$red = "localhost/panel.php";
$c = curl_init('localhost/login.php');
curl_setopt($c, CURLOPT_POSTFIELDS, $pd);
a login le envio los datos.
entonces pense en redireccionar a panel.php para ver si se logeo o no pero no puedo intente de esta forma
curl_setopt($c,CURLOPT_FOLLOWLOCATION,$red);
pero siempre me muestra el login.php, entonces no se que estoy asiendo mal, si e almacenado las cookies.
13  Programación / PHP / uso de script en php en: 20 Mayo 2011, 23:36 pm
buenas tardes quiero utilizar este script para conectarme a twitter
Código:
<?php
$_pluginInfo=array(
'name'=>'Twitter',
'version'=>'1.1.1',
'description'=>"Get the contacts from a Twitter account",
'base_version'=>'1.8.0',
'type'=>'social',
'check_url'=>'http://twitter.com',
'requirement'=>'user',
'allowed_domains'=>false,
);
/**
 * Twitter Plugin
 *
 * Imports user's contacts from Twitter and
 * posts a new tweet from the user as a invite.
 *
 * @author OpenInviter
 * @version 1.0.3
 */
class twitter extends OpenInviter_Base
{
private $login_ok=false;
public $showContacts=true;
public $requirement='user';
public $internalError=false;
public $allowed_domains=false;
protected $timeout=30;
protected $maxUsers=100;

public $debug_array=array(
'initial_get'=>'username',
'login_post'=>'inbox',
'friends_url'=>'list-tweet',
'wall_message'=>'latest_text',
'send_message'=>'inbox'
);

/**
* Login function
*
* Makes all the necessary requests to authenticate
* the current user to the server.
*
* @param string $user The current user.
* @param string $pass The password for the current user.
* @return bool TRUE if the current user was authenticated successfully, FALSE otherwise.
*/
public function login($user,$pass)
{
$this->resetDebugger();
$this->service='twitter';
$this->service_user=$user;
$this->service_pass=$pass;
if (!$this->init()) return false;
$res=$this->get("https://mobile.twitter.com/session/new",true);
if ($this->checkResponse('initial_get',$res))
$this->updateDebugBuffer('initial_get',"https://mobile.twitter.com/session/new",'GET');
else
{
$this->updateDebugBuffer('initial_get',"https://mobile.twitter.com/session/new",'GET',false);
$this->debugRequest();
$this->stopPlugin();
return false;
}

$form_action="https://mobile.twitter.com/session";
$post_elements=array('authenticity_token'=>$this->getElementString($res,'name="authenticity_token" type="hidden" value="','"'),'username'=>$user,'password'=>$pass);
$res=$this->post($form_action,$post_elements,true);
if ($this->checkResponse('login_post',$res))
$this->updateDebugBuffer('login_post',"{$form_action}",'POST',true,$post_elements);
else
{
$this->updateDebugBuffer('login_post',"{$form_action}",'POST',false,$post_elements);
$this->debugRequest();
$this->stopPlugin();
return false;
}
$this->login_ok="http://mobile.twitter.com/{$user}/followers";
return true;
}

/**
* Get the current user's contacts
*
* Makes all the necesarry requests to import
* the current user's contacts
*
* @return mixed The array if contacts if importing was successful, FALSE otherwise.
*/
public function getMyContacts()
{
if (!$this->login_ok)
{
$this->debugRequest();
$this->stopPlugin();
return false;
}
else $url=$this->login_ok;
$res=$this->get($url);
if ($this->checkResponse('friends_url',$res))
$this->updateDebugBuffer('friends_url',"{$url}",'GET');
else
{
$this->updateDebugBuffer('friends_url',"{$url}",'GET',false);
$this->debugRequest();
$this->stopPlugin();
return false;
}
$contacts=array();$countUsers=0;
do
{
$nextPage=false;
$doc=new DOMDocument();libxml_use_internal_errors(true);if (!empty($res)) $doc->loadHTML($res);libxml_use_internal_errors(false);
$xpath=new DOMXPath($doc);
$query="//a[@name]";$data=$xpath->query($query);
foreach ($data as $node)
{
$user=(string)$node->getAttribute("name");
if (!empty($user)) {$contacts[$countUsers]=$user; $countUsers++; }
}
$query="//div[@class='list-more']/a";$data=$xpath->query($query);
foreach($data as $node) { $nextPage=$node->getAttribute("href");break; }
if ($countUsers>$this->maxUsers) break;
if (!empty($nextPage)) $res=$this->get('http://mobile.twitter.com'.$nextPage);
}
while ($nextPage);
return $contacts;
}

/**
* Send message to contacts
*
* Sends a message to the contacts using
* the service's inernal messaging system
*
* @param string $cookie_file The location of the cookies file for the current session
* @param string $message The message being sent to your contacts
* @param array $contacts An array of the contacts that will receive the message
* @return mixed FALSE on failure.
*/
public function sendMessage($session_id,$message,$contacts)
{
$countMessages=0;$res=$this->get("http://mobile.twitter.com");$auth=$this->getElementString($res,'name="authenticity_token" type="hidden" value="','"');

$form_action="http://mobile.twitter.com";
$post_elements=array("authenticity_token"=>$auth,'tweet[text]'=>$message['body'],'tweet[in_reply_to_status_id]'=>false,'tweet[lat]'=>false,'tweet[long]'=>false,'tweet[place_id]'=>false,'tweet[display_coordinates]'=>false);
$res=$this->post($form_action,$post_elements,true);

foreach($contacts as $screen_name)
{
$countMessages++;$form_action='http://mobile.twitter.com/inbox';
$post_elements=array('authenticity_token'=>$auth,'message[text]'=>$message['body'],'message[recipient_screen_name]'=>$screen_name,'return_to'=>false,);
$res=$this->post($form_action,$post_elements,true);
if ($this->checkResponse('send_message',$res))
$this->updateDebugBuffer('send_message',"{$form_action}",'POST',true,$post_elements);
else
{
$this->updateDebugBuffer('send_message',"{$form_action}",'POST',false,$post_elements);
$this->debugRequest();
$this->stopPlugin();
return false;
}
sleep($this->messageDelay);
if ($countMessages>$this->maxMessages) {$this->debugRequest();$this->resetDebugger();$this->stopPlugin();break;}
}
}

/**
* Terminate session
*
* Terminates the current user's session,
* debugs the request and reset's the internal
* debudder.
*
* @return bool TRUE if the session was terminated successfully, FALSE otherwise.
*
*/
public function logout()
{
if (!$this->checkSession()) return false;
$this->get("http://twitter.com/logout");
$this->debugRequest();
$this->resetDebugger();
$this->stopPlugin();
return true;
}
}

?>

quiero llamar el code en x.php desde aqui quiero enviar mi user y password para que lo valide y si es incorrecto me mande el error y si se ingreso me diga que mi login fue correcto, no se usar esta clase y no se si todo el codigo me sirva solo quiero hacer el login. como lo tendria que usar?
14  Informática / Hardware / Laptop no enciende en: 29 Abril 2011, 22:11 pm
cuando una laptop no enciende, solo el led del eliminador que pruebas hay que realizar?
y otra pregunta como es posible saber que el problema es la ram, la mother o el procesador ?  si no cuento con otras para probarlas, es posible que manualmente se pueda llegar a la concluicion ?  
15  Programación / PHP / correos en php gmail en: 24 Enero 2011, 20:48 pm
es posible enviar correos con php desde gmail ? sin usar phpmailer ?
logre una conexion imap con php pero no se si con este protocolo se puedan enviar correos, si con smtp se puede desde gmail como seria ?
16  Programación / PHP / pop3 en php en: 19 Enero 2011, 04:57 am
como puedo crear un login sencillo para logearme a pop3 a hotmail ?
ya e intentado pero no e tenido exito y e buscado en google y ningun script  me a funcionado
Páginas: 1 [2]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines