-
-
Save Drarok/73301886f000cac677cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$username = 'trololololol'; | |
$password = 'trololololol'; | |
$url = 'http://some-project.localdev/'; | |
// Set some curl options. | |
$ch = curl_init(); | |
curl_setopt_array($ch, array( | |
CURLOPT_HEADER => false, // This is default and could be omitted? | |
CURLOPT_NOBODY => false, // Also default. | |
CURLOPT_URL => $url, | |
CURLOPT_SSL_VERIFYHOST => 0, // Get an SSL cert, you cheapskate. | |
CURLOPT_USERPWD => $username . ':' . $password, | |
CURLOPT_HTTPAUTH => CURLAUTH_BASIC, | |
CURLOPT_RETURNTRANSFER => true, // Return the transfer as a string of the return value of curl_exec() instead of outputting it out directly to stdout. | |
)); | |
// Pull the whole thing in to a variable. | |
$html = curl_exec($ch); | |
// Close the connection. | |
curl_close($ch); | |
echo $html; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment