close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

MySqli Login stay on same page

Thread began 8/29/2019 8:37 am by Adam | Last modified 9/12/2019 10:06 am by Adam | 1244 views | 13 replies

Adam

MySqli Login stays on same page

I just set up a page to use as a login, but when I attempt to login, it just stays on the same page and tacks on:

/?username=admin&password=admin&LOGIN=LOGIN

to the end of the url. It never redirects to the success page. The same thing happens when it fails.

I just have a simple form (see below)...and then using the webassist server behavior Login User.

If i change the method to post, it just goes to the failed page no matter what username and password i put in the fields.

Any thoughts?

<form action="" method="get" name="user">    
<div>
<input id="username" name="username" type="text" placeholder="Username...">
</div>
<div>
<input id="password" name="pwd" type="password" placeholder="Password...">
</div>
<div>
<input name="LOGIN" type="submit" value="LOGIN">
</div>
</form>



This is what was automatically added to the page.

<?php require_once('../Connections/Claudia.php'); ?>
<?php require_once('../webassist/mysqli/authentication.php'); ?>
<?php
$Authenticate = new WA_MySQLi_Auth($Claudia);
$Authenticate->Action = "authenticate";
$Authenticate->Trigger = ($_SERVER["REQUEST_METHOD"] === "POST");
$Authenticate->Name = "user";
$Authenticate->Table = "users";
$Authenticate->addFilter("username", "=", "s", "".((isset($_GET["username"]))?$_GET["username"]:"") ."");
$Authenticate->addFilter("password", "=", "s", "".((isset($_GET["pwd"]))?$_GET["pwd"]:"") ."");
$Authenticate->RememberMe = (true);
$Authenticate->SaveLogin = (true);
$Authenticate->AutoReturn = false;
$SuccessRedirect = "home.php";
$FailedRedirect = "fail.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();
?>

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...