Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

228
Vistas
Login to website and get the redirected url content with PHP

I am trying to get the content (text) from a website where I am a member, I found a plenty of examples of how to do this using cURL to login and get the context, however I am not sure how to handle with the redirection after I get log into the website. The result that I got from the code below is the login form (Example #1 here). I am wondering if I have no access is this really possible to do?

$postdata = http_build_query(
    array(
    'Account' => 'myaccount',
    'Password' => 'mypass'
    )
 );

$opts = array('http' =>
        array(
         'method'  => 'POST',
         'header'  => 'Content-type: application/x-www-form-urlencoded',
         'content' => $postdata
    )
  );

$context  = stream_context_create($opts);

$result = file_get_contents('http://www.website.php/login.php', false, 
$context);

After the login successful what I expect is to get the text from the redirected url which looks like http://www.website.php/other.php

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda