задача:передать в файл 4.php значение переменной 's'
эта няша прописана в отдельном файле!
var request;
try {
request = new XMLHttpRequest();
} catch (trymicrosoft) {
try {
request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (othermicrosoft) {
try {
request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (failed) {
request = false;
}
}
}
if (!request)
alert("Error initializing XMLHttpRequest!");
request.onreadystatechange=function()
{
if (request.readyState==4) // if the data transfer has been completed
{
if(request.status==200) // if server response equal "200 OK"
{
document.getElementById("resp").innerHTML=request.responseText; // recording results in the field
}
else //if server response not equal "200 OK"
{
alert('Error while creating connection with server');// error message
}
}
else //if the data from the server isn't loaded that
{
document.getElementById("resp").innerHTML='Loading...'; // recording notice in the field
}
}
request.open("POST", '4.php', true);
s='123456';
request.send(s);
это содержание файла 4.php
<?php
var_dump($_POST);
?>
мне выводит
ПУСТОЙ массив!!!