From JavaScript into PHP
Posted: Sat Jun 01, 2002 1:37 am
I have this script which does the FIRST part of what I am trying to do.
<script language = "JavaScript">
//Setup variables
var xmlhttp
var XMLHttpRequest
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
//Setup the Request
xmlhttp.open("GET", "homepage.php", true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
alert(xmlhttp.responseText)
}
}
xmlhttp.send(null)
</script>
<?
//Do something with the Result
?>
What I want to do now is put the result (responseText) into a variable in PHP so that I can manipulate it further? I expect it's quite simple?
<script language = "JavaScript">
//Setup variables
var xmlhttp
var XMLHttpRequest
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
//Setup the Request
xmlhttp.open("GET", "homepage.php", true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
alert(xmlhttp.responseText)
}
}
xmlhttp.send(null)
</script>
<?
//Do something with the Result
?>
What I want to do now is put the result (responseText) into a variable in PHP so that I can manipulate it further? I expect it's quite simple?