The ajax code:
Server side code:Code:var xmlHttp = GetXmlHttpObject(); if (xmlHttp == null) { window.alert("Your browser does not support ajax.\n Please use latest version of your browser."); return; } if (xmlHttp.overrideMimeType) xmlHttp.overrideMimeType("text/xml"); xmlHttp.open("POST", "signup_server.php", true); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form- urlencoded; charset=UTF-8"); var str = "name=n"; xmlHttp.send(str); xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4) { if (xmlHttp.status == 200) { window.status = xmlHttp.responseText; } else window.alert("Error " + xmlHttp.status + ": " + xmlHttp.statusText); } }
After execution, the window.status contains "Name not found." string. Why the server cannot get the name=n? I'm using IIS in Windows XP SP2 and PHP version 5.2.5.Code:<?php if (isset($_POST["name"])) echo $_POST["name"]; else echo "Name not found."; ?>
Thanks in advance.


Reply With Quote
Bookmarks