-3

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!

Lawrence Cherone
  • 46,049
  • 7
  • 62
  • 106

1 Answers1

1

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.

Tobias Golbs
  • 4,586
  • 3
  • 28
  • 49