Skip to content

Instantly share code, notes, and snippets.

@ivanmercedes
Created May 10, 2025 16:47
Show Gist options
  • Select an option

  • Save ivanmercedes/9473320a35ae50fd408a819f0a4cef0b to your computer and use it in GitHub Desktop.

Select an option

Save ivanmercedes/9473320a35ae50fd408a819f0a4cef0b to your computer and use it in GitHub Desktop.
<?php
header('Content-Type: application/json');
header("Access-Control-Allow-Origin: *");
$username = 'TU_USERNAME';
$password = 'TU_PASSWORD';
$api_url = "https://el-api-de-pepe-donis.com/auth";
$ch = curl_init($api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
http_response_code($http_code);
echo $response;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment