What's wrong with my PHP?

Nathan

New member
Here is my excerpt at www.mydomain.com/index.php:

<form action="http://www.mydomain.com/news/login.php" method="post">
<?php if(isset($_GET['login'])) echo "\t\t\t\t\t<p class=\"alert\">Email address and password do not match our records.</p>\r\n"; ?>
<p><input placeholder="email address" type="email" name="email" id="login_em" /></p>
<p><input placeholder="password" type="password" name="password" id="login_pw" /></p>
<p><input class="submit" type="submit" id="login_sm" name="submit" value="Log In" /></p>
</form>


And here is http://www.mydomain.com/news/login.php:

<?php
require_once "_lib/global.php";
if(empty($_SERVER["HTTP_REFERER"])) $_SERVER["HTTP_REFERER"]="index.php";
foreach($_POST as $key=>$value) $_POST[$key]=htmlentities($value,ENT_QUOTES);
if(isset($_POST["email"]) && isset($_POST["password"])) {
if(eb_login($_POST['email'],$_POST['password'],0)) header("Location: ".$_SERVER["HTTP_REFERER"]);
else {
if(strpos($_SERVER["HTTP_REFERER"],"?")) $_SERVER["HTTP_REFERER"].="&login=fail";
else $_SERVER["HTTP_REFERER"].="?login=fail";
header("Location: ".$_SERVER["HTTP_REFERER"]);
}
}
else header("Location: ".$_SERVER["HTTP_REFERER"]);
?>


I get an error saying The server closed the connection without sending any data (No data received). What did I do wrong?
 
Back
Top