scrapdog Posted November 27, 2006 Share Posted November 27, 2006 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_us2. 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 connectioncurl_close($curl_handle);[/code]Any help would be greatly appreciated. Thanks! Link to comment https://forums.phpfreaks.com/topic/28630-php-and-jhtml-authenticate-using-https/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.