I am trying to build a simple application in which the client writes few JAVA script variables to a file in the server, over the course of interaction with the user. I have the following method to send a variable to PHP. I am not able to know: (a) how to read this variable in examp.php? (b) how to pass multiple variables? I am a beginner in programming with these languages.
<script type="text/javascript">
if (window.XMLHttpRequest){
xmlhttp=new XMLHttpRequest();
}
else{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
var PageToSendTo = "examp.php?";
var MyVariable = "Hello, how are you?";
var VariablePlaceholder = "data=";
var UrlToSend = PageToSendTo + VariablePlaceholder + MyVariable;
//XMLHttpRequestObject.send("data=" + sTime);
xmlhttp.open("POST", UrlToSend, false);
xmlhttp.send();
</script>