這是我在sign-up.ts
HTTP POST請求從離子2個前PHP服務器端
let link = "http://localhost/signup.php";
this.http.post(link, signupdata)
.subscribe(data => {
console.log("Success");
},error => {
console.log("Error");
});
代碼時,我提出我碰到下面的錯誤在我的控制檯形式
XMLHttpRequest cannot load http://localhost/signup.php. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access.
幫幫我在解決這個問題。
的可能的複製[「否‘訪問控制允許來源’標頭出現在所請求的資源」(HTTP: //www.stackoverflow.com/questions/20035101/no-access-control-allow-origin-header-is-present-on-the-requested-resource) – Alex