Retrieving a password protected page using PHP

<?php
$url = 'http://username:password@www.w3mentor.com/protected.php';
$page = file_get_contents($url);
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.