Ver Mensaje Individual
  #5 (permalink)  
Antiguo 25/10/2010, 10:01
Avatar de abimaelrc
abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 15 años
Puntos: 1517
Respuesta: file_get_contents con cookie

Lo que hice y me funcionó. Cree un archivo llamado
a.php
Código PHP:
Ver original
  1. <?php
  2. var_dump($_COOKIE);
b.php
Código PHP:
Ver original
  1. <?php
  2. $options = array('http' =>
  3.     array(
  4.         'header'  => 'Content-type: text/plain;charset=UTF-8' . PHP_EOL .
  5.         'Cookie: user=FDW; actividad=programacion;' . PHP_EOL
  6.     )
  7. );
  8. $context = stream_context_create($options);
  9. $page = file_get_contents('http://localhost/a.php', false, $context);
  10. echo $page;
__________________
Verifica antes de preguntar.
Los verdaderos amigos se hieren con la verdad, para no perderlos con la mentira. - Eugenio Maria de Hostos