Jump to content

scrapdog

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

scrapdog's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi all, I'm new to PHP but have experience with other languages. I'm currently trying to do the following: 1. Authenticate to https://www.example.com/example/v1/services/app/external_profile_login.jhtml?login=username&password=password&locale=en_us 2. Pull XML from http://www.example.com/example/v1/services/app/get_user_data.jhtml (this page is essentially just XML) In order to get any data from the second page, you must be authenticated. When I do the above in a web browser it works fine (and maintains the session as required). Here is what I have so far (don't laugh too hard) after learning about cURL: [code]// Declare vars $xsl = new DomDocument(); $inputdom = new DomDocument(); $proc = new XsltProcessor(); // Authenticate $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL,'https://www.example.com/example/v1/services/app/external_profile_login.jhtml?login=username&password=password&locale=en_us'); curl_exec($curl_handle); // Load the XML $inputdom->load("http://www.example.com/example/v1/services/app/get_user_data.jhtml"); // Bind $xsl = $proc->importStylesheet($xsl); // Output the information! $newdom = $proc->transformToDoc($inputdom); print $newdom->saveXML(); // Close the connection curl_close($curl_handle);[/code] Any help would be greatly appreciated. Thanks!
×
×
  • 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.