Skip to content

Instantly share code, notes, and snippets.

Created May 28, 2014 13:56
Show Gist options
  • Save anonymous/b346ec1b9cebf1a4bfb8 to your computer and use it in GitHub Desktop.
Save anonymous/b346ec1b9cebf1a4bfb8 to your computer and use it in GitHub Desktop.
$username = 'trololololol';
$password = 'trololololol';
$url='trolololololtrolololololtrolololololtrolololololtrolololololtrolololololtrololololol';
# Set some curl options
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_NOBODY, false);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
# Pull the whole thing in to a variable
$html = curl_exec($ch);
# Close the connection
curl_close($ch);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment