1 year ago

#373831

test-img

Jaehyuck Choi

file_get_contents() from url that is only accessible after login (No cURL)

I would like to access a page by file_get_contents(). But, this page is accessible only after login. I was wondering how I should write the code. No cURL please, as this page doesn't allow cURL...

$context = stream_context_create(
    array(
        "http" => array(
            "header" => "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36"
        )
    )
);

echo file_get_contents("https://app.kajabi.com/admin/products/545108", false, $context);

php

file-get-contents

simple-html-dom

0 Answers

Your Answer

Accepted video resources