close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

session variables not being stored from login page to index page

Thread began 9/28/2019 6:15 pm by sandy170299 | Last modified 10/02/2019 10:23 pm by sandy170299 | 54 views | 11 replies

sandy170299

Still not working. I created brand new login series of pages, and it doesn't redirect me, or give me any errors. It is supposed to redirect to index.php. This is in a completely different directory than what I was working on previously with this post.

Here is my login page:

<?php require_once('../Connections/numeroseti.php'); ?>
<?php require_once("../webassist/form_validations/wavt_scripts_php.php"); ?>
<?php require_once("../webassist/form_validations/wavt_validatedform_php.php"); ?>
<?php require_once('../webassist/mysqli/authentication.php'); ?>
<?php require_once( "../webassist/security_assist/helper_php.php" ); ?>
<?php
if ((isset($_POST["LogIn_submit"]) || isset($_POST["LogIn_submit_x"]))) {
$WAFV_Redirect = "".($_SERVER["REQUEST_URI"]) ."?invalid=true";
$_SESSION['WAVT_login_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ((isset($_POST["Log_In_group_user_name"])?$_POST["Log_In_group_user_name"]:"") . "",true,1);
$WAFV_Errors .= WAValidateEL((isset($_POST["Log_In_group_user_name"])?$_POST["Log_In_group_user_name"]:"") . "",6,100,true,2);
$WAFV_Errors .= WAValidateRQ((isset($_POST["Log_In_group_2_user_password_hash"])?$_POST["Log_In_group_2_user_password_hash"]:"") . "",true,3);
$WAFV_Errors .= WAValidateEL((isset($_POST["Log_In_group_2_user_password_hash"])?$_POST["Log_In_group_2_user_password_hash"]:"") . "",6,500,true,4);

if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"login");
}
}
?>
<?php
$Authenticate = new WA_MySQLi_Auth($numeroseti);
$Authenticate->Action = "authenticate";
$Authenticate->Trigger = (isset($_POST["LogIn_submit"]) || isset($_POST["LogIn_submit_x"]));
$Authenticate->Name = "user_id";
$Authenticate->Table = "users";
$Authenticate->addFilter("user_name", "=", "s", "".((isset($_POST["Log_In_group_user_name"]))?$_POST["Log_In_group_user_name"]:"") ."");
$Authenticate->addFilter("user_password_hash", "=", "s", "".((isset($_POST["Log_In_group_2_user_password_hash"]))?$_POST["Log_In_group_2_user_password_hash"]:"") ."");
$Authenticate->storeResult("user_id", "SecurityAssist_user_id");
$Authenticate->RememberMe = (isset($_POST["Log_In_group_3_Remember_my_information"]));
$Authenticate->SaveLogin = (isset($_POST["Log_In_group_4_Log_me_in_automatically"]));
$Authenticate->AutoLogin = true;
$Authenticate->AutoReturn = true;
$SuccessRedirect = "index.php";
$FailedRedirect = "login.php?failedLogin=1";
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();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="../webassist/progress_bar/jquery-blockui-formprocessing.js" type="text/javascript"></script>
<link href="../webassist/forms/fd_basic_default.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="../webassist/jq_validation/Bloom.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
</head>

<body>
<?php if(WA_Auth_RulePasses("Validated form")){ // Begin Show Region ?>
<p>Invalid username or password</p>
<?php } // End Show Region ?>
<?php if(WA_Auth_RulePasses("Log in success")){ // Begin Show Region ?>
<p>You have been logged in</p>
<?php } // End Show Region ?>
<?php if(WA_Auth_RulePasses("Failed log in")){ // Begin Show Region ?>
<p>Invalid username or password</p>
<?php } // End Show Region ?>
<?php if(WA_Auth_RulePasses("Emailed password")){ // Begin Show Region ?>
<p>Password information emailed, please check your inbox</p>
<?php } // End Show Region ?>
<?php if(WA_Auth_RulePasses("Successful update")){ // Begin Show Region ?>
<p>Registration completed successfully, please log in to access the site</p>
<?php } // End Show Region ?>
<div id="LogInContainer" class="WAATK">
<div id="LogIn_Basic_Default_ProgressWrapper">
<form class="Basic_Default" id="LogIn_Basic_Default" name="LogIn_Basic_Default" method="post" action="">
<fieldset class="Basic_Default" id="Log_In">
<legend class="groupHeader">Log In</legend>
<span class="fieldsetDescription"> Required * </span>
<div class="lineGroup">
<label for="Log_In_group_user_name" class="sublabel" > user_name:<span class="requiredIndicator">&nbsp;*</span></label>
<input id="Log_In_group_user_name" name="Log_In_group_user_name" type="password" value="" class="formPasswordfield_Medium" tabindex="1" title="Please enter a value." confirm="" required="true" />
<?php
if (ValidatedField('login','login')) {
if ((strpos((",".ValidatedField("login","login").","), "," . "1" . ",") !== false || "1" == "") || (strpos((",".ValidatedField("login","login").","), "," . "2" . ",") !== false || "2" == "")) {
if (!(false)) {
?>
<span class="serverInvalidState" id="Log_In_group_user_name_ServerError">Please enter a value.</span>
<?php //WAFV_Conditional login.php login(1,2:)
}
}
}?>
</div>
<div class="lineGroup">
<label for="Log_In_group_2_user_password_hash" class="sublabel" > user_password_hash:<span class="requiredIndicator">&nbsp;*</span></label>
<input id="Log_In_group_2_user_password_hash" name="Log_In_group_2_user_password_hash" type="password" value="" class="formPasswordfield_Medium" tabindex="2" title="Please enter a value." confirm="Log_In_group_user_name" required="true" />
<?php
if (ValidatedField('login','login')) {
if ((strpos((",".ValidatedField("login","login").","), "," . "3" . ",") !== false || "3" == "") || (strpos((",".ValidatedField("login","login").","), "," . "4" . ",") !== false || "4" == "")) {
if (!(false)) {
?>
<span class="serverInvalidState" id="Log_In_group_2_user_password_hash_ServerError">Please enter a value.</span>
<?php //WAFV_Conditional login.php login(3,4:)
}
}
}?>
</div>
<div class="lineGroup">
<label class="checklabel" for="Log_In_group_3_Remember_my_information">
<input type="checkbox" name="Log_In_group_3_Remember_my_information" id="Log_In_group_3_Remember_my_information" value="1" class="formCheckboxField_Standard" <?php if (!(strcmp((isset($_GET["invalid"])?ValidatedField("login","Log_In_group_3_Remember_my_information"):"".(isset($_COOKIE["RememberMe_user_name"])?"1":"") .""),"1"))) {echo "checked=\"checked\"";} ?> tabindex="3" title="Please enter a value" />
&nbsp;Remember my information</label>
</div>
<div class="lineGroup">
<label class="checklabel" for="Log_In_group_4_Log_me_in_automatically">
<input type="checkbox" name="Log_In_group_4_Log_me_in_automatically" id="Log_In_group_4_Log_me_in_automatically" value="1" class="formCheckboxField_Standard" <?php if (!(strcmp((isset($_GET["invalid"])?ValidatedField("login","Log_In_group_4_Log_me_in_automatically"):"".(isset($_COOKIE["AutoLogin_user_name"])?"1":"") .""),"1"))) {echo "checked=\"checked\"";} ?> tabindex="4" title="Please enter a value" />
&nbsp;Log me in automatically</label>
</div>
<span class="buttonFieldGroup" >
<input class="formButton" name="LogIn_submit" type="submit" id="LogIn_submit" value="Log In" onclick="clearAllServerErrors('LogIn_Basic_Default')" tabindex="5" />
</span>
</fieldset>
</form>
</div>
<div id="LogIn_Basic_Default_ProgressMessageWrapper" class="blockUIOverlay" style="display:none;">
<script type="text/javascript">
WADFP_SetProgressToForm('LogIn_Basic_Default', 'LogIn_Basic_Default_ProgressMessageWrapper', WADFP_Theme_Options['BigSpin:Slate']);
</script>
<div id="LogIn_Basic_Default_ProgressMessage" >
<p style="margin:10px; padding:5px;" ><img src="../webassist/progress_bar/images/slate-largespin.gif" alt="" title="" style="vertical-align:middle;" />&nbsp;&nbsp;Please wait</p>
</div>
</div>
</div>
<script src="../webassist/forms/wa_servervalidation.js" type="text/javascript"></script>
<script src="../webassist/jq_validation/jquery.h5validate.js"></script>
<script>
var LogIn_Basic_Default_Opts = {
focusout: true,
focusin: false,
change: false,
keyup: false,
popupClass: "Bloom",
pointedAt: "left",
fieldOffset: 10,
fieldMargin: 2,
position: "left",
direction: "left",
border: 1,
offset: 25,
closeText: "✖",
percentWidth: 100,
orientation: "bottom"
};
function LogIn_Basic_Default_Validate() {
$("#LogIn_Basic_Default").h5Validate(LogIn_Basic_Default_Opts);
}
$(document).ready(function () {
LogIn_Basic_Default_Validate()
ConvertServerErrors(LogIn_Basic_Default_Opts);
});
</script>
</body>
</html>

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...