Jump to content

XML + Auth


dealer

Recommended Posts

Hi,

im trying to access an xml file on a remote server that requires auth before allowing access. i was given the following code as an example:

[code=php:0]
<?
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookieFileName");
curl_setopt($ch, CURLOPT_URL,"https://myeve.eve-online.com/login.asp");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "username=*******&password=********&Check=OK");

ob_start(); // prevent any output
curl_exec ($ch); // execute the curl command
ob_end_clean(); // stop preventing output

curl_close ($ch);
unset($ch);

$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookieFileName");
curl_setopt($ch, CURLOPT_URL,"http://myeve.eve-online.com/character/xml2.asp?characterID=679467044");

$buf2 = curl_exec ($ch);

curl_close ($ch);
header("Content-Type: text/xml");
echo $buf2;
?>
[/code]

I have no idea how to get this working tho, or even if it works, i simply want the xml data from the address in the code above to be passed on to a parser.

any help on this wud be appreciated.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.