I do this:
function Signup() { var email = document.getElementById("email").value; var password = document.getElementById("password").value; var name = document.getElementById("name").value; var xmlhttp = getXmlHttp(); xmlhttp.open('POST', 'Signup/SignupUser.php', true); // Открываем асинхронное соединение xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); // Отправляем кодировку xmlhttp.send("name=" + encodeURIComponent(name), "password=" + encodeURIComponent(password), "email=" + encodeURIComponent(email)); // Отправляем POST-запрос xmlhttp.onreadystatechange = function() { // Ждём ответа от сервера if (xmlhttp.readyState == 4) { // Ответ пришёл if(xmlhttp.status == 200) { // Сервер вернул код 200 (что хорошо) document.getElementById("sdf").innerHTML = xmlhttp.responseText; // Выводим ответ сервера } } }; }
The error is probably here.
xmlhttp.send("name=" + encodeURIComponent(name), "password=" + encodeURIComponent(password), "email=" + encodeURIComponent(email));
But what to do, I do not know :(