Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

221
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!