Jump to content

Authenticating a PHP proxy


ryancanulla

Recommended Posts

Hi there,

 

I'm using this php proxy with a flex app to get around security issues, and need to authenticate with a username/password to get back my xml.

 

Anyone know how I could modify this php script to pass in credentials via POST?

 

<?php
$ch = curl_init();
$timeout = 30;
$userAgent = $_SERVER['HTTP_USER_AGENT'];

curl_setopt($ch, CURLOPT_URL, $_REQUEST['url']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);

$response = curl_exec($ch);    

if (curl_errno($ch)) {
    echo curl_error($ch);
} else {
    curl_close($ch);
    echo $response;
}
?>

Link to comment
https://forums.phpfreaks.com/topic/195264-authenticating-a-php-proxy/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.