Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/366.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript PHP中注册表单的一种奇异行为_Javascript_Php_Html_Twitter Bootstrap - Fatal编程技术网

Javascript PHP中注册表单的一种奇异行为

Javascript PHP中注册表单的一种奇异行为,javascript,php,html,twitter-bootstrap,Javascript,Php,Html,Twitter Bootstrap,我在我的(项目的)网站上有以下表格的注册表格:(我使用了bootstrap框架): 此标题可能会在主页上重定向,但它不会这样做! 如果我不使用带有引导和javascript代码的页面,而是用以下方式修改注册页面: <body> <h1>Registration</h1> <form action="" method="post"> <?php if (isset($registerError)):

我在我的(项目的)网站上有以下表格的注册表格:(我使用了bootstrap框架):

此标题可能会在主页上重定向,但它不会这样做! 如果我不使用带有引导和javascript代码的页面,而是用以下方式修改注册页面:

<body>
    <h1>Registration</h1>       
    <form action="" method="post">
        <?php if (isset($registerError)): ?>
            <p><?php echo $registerError; ?></p>
        <?php endif; ?>
        <div>
            <label for="name">Nome completo: <input type="text" name="nome"
                id="nome"></label>
        </div>
        <div>
            <label for="email">Email: <input type="text" name="email"
                id="email"></label>
        </div>
        <div>
            <label for="password">Password: <input type="password"
                name="password" id="password"></label>
        </div>
        <div>
            <input type="submit" value="Invio">
        </div>
    </form>
</body>

登记

Nome completo: 电邮: 密码:
现在控制器在主页上正确重定向!
我无法解释这种行为,任何帮助都将不胜感激!谢谢

在您的php文件中,有以下内容:

header('Location: .');

可能默认情况下,您的web应用程序在index.html上重定向,因为它是默认根。

另外index.php是默认根,如果您在包含index.php文件的文件夹上打开web应用程序,它将默认打开。meSo index.php是您的默认页面,这是一个非常奇怪的错误。更改另一个重定向的头位置我已经做了,但是:对于第二个模板(没有引导和javascript代码),重定向可以工作。在第一种情况下,当我添加引导CSS和javascript代码时,不起作用,浏览器重定向到“/localhost/mysite/?register”页面,其中有模板。非常感谢,您的帮助非常重要
<body>
    <h1>Registration</h1>       
    <form action="" method="post">
        <?php if (isset($registerError)): ?>
            <p><?php echo $registerError; ?></p>
        <?php endif; ?>
        <div>
            <label for="name">Nome completo: <input type="text" name="nome"
                id="nome"></label>
        </div>
        <div>
            <label for="email">Email: <input type="text" name="email"
                id="email"></label>
        </div>
        <div>
            <label for="password">Password: <input type="password"
                name="password" id="password"></label>
        </div>
        <div>
            <input type="submit" value="Invio">
        </div>
    </form>
</body>
header('Location: .');