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

See username after login on landing page, restrict access to the page and logout

Thread began 9/19/2018 6:03 am by María Luisa | Last modified 9/27/2018 3:11 am by María Luisa | 339 views | 24 replies

María Luisa

On question 2)

Hello again and thanks.

This is my code on the page where the login form is:

<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
?>
<?php require_once('../Connections/Prueba_MCC_i.php'); ?>
<?php require_once('../webassist/mysqli/rsobj.php'); ?>
<?php require_once('../webassist/mysqli/authentication.php'); ?>
<?php
$Recordset1 = new WA_MySQLi_RS("Recordset1",$Prueba_MCC_i,1);
$Recordset1->setQuery("SELECT usuarios.u_email, usuarios.u_password, usuarios.u_nombre_completo FROM usuarios");
$Recordset1->execute();?>
<?php
$Authenticate = new WA_MySQLi_Auth($Prueba_MCC_i);
$Authenticate->Action = "authenticate";
$Authenticate->Trigger = ($_SERVER["REQUEST_METHOD"] == "POST");
$Authenticate->Name = "MCC_usuario";
$Authenticate->Table = "usuarios";
$Authenticate->addFilter("u_email", "=", "s", "".($Recordset1->getColumnVal("u_email")) ."");
$Authenticate->addFilter("u_password", "=", "s", "".($Recordset1->getColumnVal("u_password")) ."");
$Authenticate->storeResult("u_nombre_completo", "u_nombre_completo");
$Authenticate->storeResult("u_email", "u_email");
$Authenticate->RememberMe = false;
$Authenticate->SaveLogin = false;
$Authenticate->AutoReturn = false;
$SuccessRedirect = "edicion.php";
$FailedRedirect = "MCC_error.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();
?>

I would say that it saves session variables. Specifically:

$Authenticate->storeResult("u_nombre_completo", "u_nombre_completo");
$Authenticate->storeResult("u_email", "u_email");

Although now there is another problem: I get the connection errors and neither arrives at the error page nor at the login page. These are the errors that it gives me that have to do with the automatic script generated by MySQLi SB authentication.php

Notice: Undefined property: WA_MySQLi_Auth::$Log in /Applications/MAMP/htdocs/MCC_01_edicion_DW/webassist/mysqli/authentication.php on line 274

Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/MCC_01_edicion_DW/webassist/mysqli/authentication.php:274) in /Applications/MAMP/htdocs/MCC_01_edicion_DW/webassist/mysqli/authentication.php on line 445

--- line 274:
if (sizeof($this->Log) > 0) {

---line 445:
header("location: " . $this->addQuerystring($url));


I do not understand what is happening. Thanks for the help.

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