Dynamic Login/Logout Link
Is there way with the User Reg Pack to dynamically update a login/logout button or link if the user is logged in or not?
Is there way with the User Reg Pack to dynamically update a login/logout button or link if the user is logged in or not?
Yes, you can use this code to dynamically show login/ log out:
<?php if(WA_Auth_RulePasses("Logged in to users")){ // Begin Show Region ?>
<a href="users_LogOut.php">Log Out</a>
<?php } // End Show Region ?>
<?php if(!WA_Auth_RulePasses("Logged in to users")){ // Begin Show Region ?>
<a href="users_LogIn.php">Log In</a>
<?php } // End Show Region ?>
Jason,
For some reason, it's not posting to the page. I've got the links attached to a navigation css, so they're getting styled. That shouldn't effect the php, right?
Here's what I've got, along with your above code inserted:
<div id="navcontainer">
<ul id="navlist">
<li><a href="index.php">Home</a></li>
<li><?php if(WA_Auth_RulePasses("Logged in to users")){ // Begin Show Region ?>
<a href="users_LogOut.php">Log Out</a>
<?php } // End Show Region ?>
<?php if(!WA_Auth_RulePasses("Logged in to users")){ // Begin Show Region ?>
<a href="users_LogIn.php">Log In</a>
<?php } // End Show Region ?></li>
</ul>
</div>
Same code as above, just in the php container.
<div id="navcontainer">
<ul id="navlist">
<li><a href="index.php">Home</a></li>
<li><?php if(WA_Auth_RulePasses("Logged in to users")){ // Begin Show Region ?>
<a href="users_LogOut.php">Log Out</a>
<?php } // End Show Region ?>
<?php if(!WA_Auth_RulePasses("Logged in to users")){ // Begin Show Region ?>
<a href="users_LogIn.php">Log In</a>
<?php } // End Show Region ?></li>
</ul>
</div>
do you have the include files referances on the page at line 1:
<?php require_once("WA_Globals/WA_Globals.php"); ?>
<?php require_once('Connections/localhost.php'); ?>
<?php require_once( "WA_SecurityAssist/Helper_PHP.php" ); ?>
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
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.