I feel like I must be getting closer, but am just not there yet. I created my test.php file that is "exactly" as shown below. I tried a few test curl examples I found on the web to ensure that curl is working, and they all worked fine. When I use my browser and go to test.php with the code below, all I get is a blank screen... How can I know if the information is being sent correctly? Theoretically, when this information is passed, it should yield a response from XML API causing me to be logged in and open up the main page of that remote site. I didn't write the API so that code should be fine! I'll deal with the onclick execution once I can just get the code to work correctly.
What can I do to check this code for mistakes?
<?php
$xml_data ='<xml-fragment xmlns:vp="http://myhost">'.
'<vp:vprequest>'.
'<query>authenticateUser</query>'.
'</vp:vprequest>'.
'<vp:vpuser>'.
'<username>username</username>'.
'<password>password</password>'.
'<userid/>'.
'<firstname/>'.
'<lastname/>'.
'<useremail/>'.
'<assignedRoles>'.
'<roleDef/>'.
'</assignedRoles>'.
'</vp:vpuser>'.
'<vportal>'.
'<vportal_id>1</vportal_id>'.
'</vportal>'.
'</xml-fragment>';
$post_data = 'xml_data = '.$xml_data;
$URL = "https://myhost/xmlapi";
$ch = curl_init($URL);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/xml'));
curl_setopt($ch, CURLOPT_POSTFIELDS, "$post_data");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
?>