View source code with login (PHP)

I am trying to view the source code of a website which needs Google login.

I am logged into my Google account on Chrome, and I am running the php file on Chrome using XAMPP.

My code:

<?php
$homepage = file_get_contents('http://www.example.com/');
echo $homepage;
?>

However, when I echo it shows me a webpage that says I am not logged in, although I am logged in. What am I doing wrong?


Source: php

Leave a Reply