【发布时间】:2018-11-23 18:10:28
【问题描述】:
我正在做一个网页,这个网页在php上有一个表单,脚本js可以获取表单的值,然后将其发送到其他php,我在google cloud上这样做
app.yaml 是
runtime: php55
api_version: 1
handlers:
- url: /
script: index.php
- url: /index\.html
script: index.php
- url: /css
static_dir: css
- url: /js
static_dir: js
- url: /server/(.+\.php)$
script: \1
- url: /img
static_dir: img
索引、css、js 和 img 工作正常,但服务 php 脚本不工作
我的表单
<form method="post" id="formdata" action="">
<div class="form-group">
<label for="user">User</label>
<input type="text" class="form-control" id="User"name="User" aria-describedby="UserHelp" placeholder="Enter Username" required>
</div>
<div class="form-group">
<label for="Password1">Password</label>
<input type="password" class="form-control" id="Password" name="Password" placeholder="Password" required>
</div>
<div class="text-center">
<button id="botonEnviar"type="submit" class="btn btn-primary">Login</button>
</div>
</form>
我的脚本 js
$("#botonEnviar").click( function() {alert("0");
if(validaForm()){
**$.post("server/buscarUsuario.php",$("#formdata").serialize(),function(res)**{
//$("#formulario").fadeOut("slow");
if(res == 1){alert("3");
window.location.href = "https://www.google.com"; .
} else {
if(res == 99){alert("4");
$("#fracaso").delay(500).fadeIn("slow");
}
}
});
}
});
我想将帖子发送到 buscarUsuario.php ,它位于服务器文件夹中,但网页上这样说
发帖https://***.com/server/buscarUsuario.php 404 ()
我不知道该怎么办
【问题讨论】:
标签: javascript php google-cloud-platform