dtpngq3378499 2013-07-23 16:27
浏览 50

无法POST popup.html(html文件)

When I try to click the login button, it gives me the error: "Cannot POST to popup.html"

popup.html

<?php
session_start();
require_once 'php/database.php';
$membership = new login();
if($_POST && !empty($_POST['username']) && !empty($_POST['password']) {
    $response = $membership->validate_user($_POST['username'], $_POST['password']);
}
?>
<html>
    <head>
        <link href="ui-style/flat-ui.css" rel="stylesheet" type="text/css"/>
        <link href="ext.css" rel="stylesheet" type="text/css"/>
    <!-- Bootstrap Scripts -->
    <link href="http://twitter.github.io/bootstrap/assets/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="http://twitter.github.io/bootstrap/assets/css/bootstrap-responsive.css" rel="stylesheet" type="text/css" />
    <script src="http://twitter.github.io/bootstrap/assets/js/bootstrap.js"></script> <!-- Bootstrap Scripts -->
    </head>
    <body>
        <div id="login">
        <h1>Login</h1>
        <form method="post" action="">
        <input name="username" type="text" class="span3" value placeholder="Username" id="username"/><br/>
        <input name="password" type="password" class="span3" value placeholder="Password" id="password"/><br/>
        <button class="btn btn-large btn-success" id="login-btn">Login</button>
        </form>
        <?php if(isset($response)) echo $response ?>
        </div>
    </body>
</html>

What am I doing wrong?

Thanks in advance!

  • 写回答

1条回答 默认 最新

  • drus40229 2013-07-23 16:29
    关注

    Without seeing anything of your code i would say:

    You can't post to an html page. You need a page that can access the post data.

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度