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 | 347 views | 24 replies

María Luisa

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

Hello, thanks for reading.
I have the following WA code on the destination page after login:

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 require_once('../webassist/mysqli/queryobj.php'); ?>
$RestrictAccess = new WA_MySQLi_Auth();
$RestrictAccess->Action = "restrict";
$RestrictAccess->Name = "user";
$RestricAccessRedirect = "MCC_error.php";
if (function_exists("rel2abs")) $RestricAccessRedirect = $RestricAccessRedirect?rel2abs($RestricAccessRedirect,dirname(__FILE__)):"";
$RestrictAccess->FailRedirect = $RestricAccessRedirect;
$LogOut = new WA_MySQLi_Auth();
$LogOut->Action = "logout";
$LogOut->Name = "user";

In my Connections panel, the Session that has two elements appears. One of them is the name of the user (which I call "u_nombre_completo") I have dragged to the place of my document where I want it to be seen. This is the resulting code:

<div class="Llamada">
Estás autenticada/o como: <?php echo $_SESSION['u_nombre_completo']; ?><span class="Separador"> </span> | <a href="#" class="Enlace_1">Cerrar sesión</a> </div>

However, three things happen:

1. The page is not really restricted to access even though I included the WA behavior restricting access.
2. The username placed the way I did it, gives the following php error

Notice: Undefined index: u_nombre_completo in /Applications/MAMP/htdocs/MCC_01_edicion_DW/__admin/edicion.php on line 150
| Cerrar sesión

which corresponds precisely to the variable:

<?php echo $_SESSION['u_nombre_completo']; ?>

3. I can not find in MySQLi Server Behaviors the way to put the corresponding link in the button logout ("Cerrar Session")

I think I've looked at the tutorials, but I can not find the solutions to my problems.

Can anybody help me please. Thank you very much

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





Ease of use


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