嗨,我正在使用英特爾xdk開發混合應用程序。在那裏我創建了註冊表單,然後我在那裏輸入代碼。在im嘗試使用Php Mysql將我的數據庫插入到我的數據庫之後。Intel xdk Databse
如果我點擊註冊按鈕它顯示這樣的錯誤[不能POST/HTTP服務/模擬器Web服務器/紋波/ userapp/xC /用戶/系統-5 /應用程序數據/本地/ XDK/xdk-scratchdir/8167921a- fe37-4721-a49c-7e81a19997af /平臺/安卓/資產/ WWW/index.html的]
我的HTML代碼:
<form method="post" action="registration.php">
<input name="username" type="text" placeholder="Username" id="name" />
<input name="password" type="password" placeholder="Password" id="password" />
<input name="confirmpassword" type="password" placeholder="Confirm Password" id="confirmpassword" />
<input name="email" type="text" placeholder="Email" id="email" />
<input name="phonenumber" type="text" placeholder="Phone number" id="phonenumber" />
<input name="submit" type="submit" value="Register"/>
</form>
我的Javascript代碼:
function signUp(){
var credsArr = {};
credsArr["username"] = document.myform.username.value;
credsArr["password"] = document.myform.password.value;
credsArr["email"] = document.myform.password.value;
credsArr["phonenumber"] = document.myform.password.value;
var xmlhttp = new XMLHttpRequest();
var url = "http://127.0.0.1:58889/phonegap/registration.php?username=" + credsArr["username"] + "&password=" + credsArr["password"] + "&email="+credsArr["email"] + "&phonenumber="+ credsArr["phonenumber"];
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
myFunction(xmlhttp.responseText);
} else if (xmlhttp.status == 404) {
intel.xdk.notification.alert("Web Service Doesn't Exist!", "Error");
}
};
xmlhttp.open("POST", "http://127.0.0.1:58889/phonegap/registration.php", false);
xmlhttp.send();
function myFunction(response) {
var arr = JSON.parse(response);
if (arr.success == 1) {
intel.xdk.notification.alert("Registered successful!");
} else {
intel.xdk.notification.alert(arr.success + " " + arr.message);
}
}
return(true);
}
在Web服務器上安裝PHP? –
是的,我在我的服務器上安裝了php –