I use an ajax call to launch a php script on my server:
<?php
readfile("https://url.com/authenticateUser?login=test&apiKey=test");
$partNumber = urlencode($_POST['partNumber'];
readfile("https://url.com/search?\"partNumber\"=\"$partNumber\");
?>
then my script:
$.ajax({
url: "search.php";
type: "post",
dataType: "xml",
data : { partNumber : q }, //q is defined earlier....
success : function(data) {
console.log(data);
}
});
What I get returned from the server is:
2Authentication Successfultrue1Invalid UserName or Passwordfalse
so my first readfile
authenticates me as a user just fine, but then I go to make my second call and I'm logged out. What am I doing wrong here?