重定向不起作用/警告没有显示

时间:2016-10-17 10:42:32

标签: javascript php jquery

似乎无法完成这项工作。我想在提交后回到表单。但它只是显示

**Object not found!**

The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.

**Error 404**

localhost
Apache/2.4.17 (Win32) OpenSSL/1.0.2d PHP/5.6.23

并且不会弹出警报。 或者它不会弹出,因为有错误?

我的php

if (mysqli_query($con,$sql))
    {
        ?><script>
            alert('Saved Successfully!');
            window.location = ".../cnc/makerForm.php";
        </script><?php
    }

我的HTML

<div class="w3-border">
    <h6 class = "w3-grey trbl-padding-5 trbl-margin">Maker</h6>
    <a class="w3-btn-floating w3-pale-yellow" onclick="return toggleMakerBox('iframe_makerForm')">+</a>
    <iframe height="400px" width="100%" src="makerForm.php" style="display:none;" name="iframe_makerForm" id="iframe_makerForm"></iframe>
</div>

2 个答案:

答案 0 :(得分:0)

谢谢你。 我现在知道我的代码有什么问题了。我表格中的文件有误。

答案 1 :(得分:-1)

此错误表示您要定位的文件不存在。正如评论中指出的那样,很可能是因为你在重定向路径声明window.location = ".../cnc/makerForm.php";中写了......而不是..