MySQLi Log In not working
Win 10, DW CC 2014, installed extensions OK, have a Log In page, form with post method, input type email, input type password, button type button - changing to submit, have not been able to make it work, maybe this will make a difference. Nope, the page is submitting but not redirecting, going back to itself and can't display itself.
I have a MySQLi connection.
<?php require_once('../Connections/IFRMi.php'); ?>
<?php require_once('../webassist/mysqli/authentication.php'); ?>
<?php
if (($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos(urldecode($_SERVER["HTTP_REFERER"]), urldecode($_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"])) > 0) && isset($_POST)) {
$Authenticate = new WA_MySQLi_Auth($IFRMi);
$Authenticate->Action = "authenticate";
$Authenticate->Name = "";
$Authenticate->Table = "users";
$Authenticate->addFilter("Email", "=", "s", "".(((isset($_POST["email"]))?$_POST["email"]:"")) ."");
$Authenticate->addFilter("Password", "=", "s", "".WA_SHA1Encryption((((isset($_POST["password"]))?$_POST["password"]:""))) ."");
$Authenticate->storeResult("Email", "UserEmail");
$Authenticate->AutoReturn = false;
$SuccessRedirect = "../members/profile.php";
$FailedRedirect = "access-denied.php";
if (function_exists("rel2abs")) $SuccessRedirect = $SuccessRedirect?rel2abs($SuccessRedirect,dirname(__FILE__)):"";
if (function_exists("rel2abs")) $FailedRedirect = $FailedRedirect?rel2abs($FailedRedirect,dirname(__FILE__)):"";
$Authenticate->SuccessRedirect = $SuccessRedirect;
$Authenticate->FailRedirect = $FailedRedirect;
$Authenticate->execute();
}
?> and
<form name="login" class="w3-container" method="post">
<h1>Log In</h1>
<h2 class="w3-text-red">Required *</h2>
<div class="w3-cell-row w3-section">
<div class="w3-container w3-cell w3-cell-middle" style="width:150px;"><label class="w3-right">Email: * </label></div>
<div class="w3-container w3-cell w3-cell-middle w3-rest">
<input name="email" type="email" class="w3-input w3-border w3-round-large w3-sand" style="width: 200px;" />
</div>
</div>
<div class="w3-cell-row w3-section">
<div class="w3-container w3-cell w3-cell-middle" style="width:150px;"><label class="w3-right">Password: * </label></div>
<div class="w3-container w3-cell w3-cell-middle">
<input name="password" type="password" class="w3-input w3-border w3-round-large w3-sand" style="width: 200px;" />
</div>
</div>
<div class="w3-container w3-center" style="max-width:400px;">
<a href="loginforgot.php" title="forgot password?" target="_top">forgot password?</a>
</div>
<p><input name="remember" type="checkbox" class="w3-check" value="Remember" />
<label>Remember my information</label></p>
<p><input name="autolog" type="checkbox" class="w3-check" value="AutoLog" />
<label>Log me in automatically</label></p>
<p><button type="submit" class="w3-btn w3-round-large w3-khaki w3-ripple w3-hover-yellow"> Log In</button></p>
</form>