Zubrag.com :: Forum

zubrag.com => Password Protect Advanced => Topic started by: jeff on February 26, 2009, 02:47:23 PM



Title: Pass user name to welcome page
Post by: jeff on February 26, 2009, 02:47:23 PM
hi;
 Password Protect Advanced is a nice script. Just wanted to know after the user logs in , how can i pass the user login name to the page to be dispalyed in a format log "Lgged in as Jeff".

Alson when a user downlas a file , how can I write the user name to the log file ?

thanks so much
jeff


Title: Re: Pass user name to welcome page
Post by: PHPwhattt? on April 27, 2009, 09:09:25 AM
Hi i have a way you can achive this

Here's what i did

On the password_protect.php page i created a session by placing this code (

<?php
session_start();
session_register("login");
?>

) under the html.

This passes the username variable to the next page

Then on the next page you can write this to display the logged in users name

Place this on the page

<?php
session_start();
session_register("login");
?>

Then you can place this wherever you need it in your html code

Welcome <?php echo $login ?> to my site.

Hope this helps

Simon


Title: Re: Pass user name to welcome page
Post by: jimmyhendrix on November 01, 2010, 10:32:37 AM
The code work fine only for the first time. If I refresh the page or go to another, that doesn't work anymore.

Somebody have a way to display the login info whenever you want ?

Jimmy


Title: Re: Pass user name to welcome page
Post by: zubrag on November 01, 2010, 11:55:18 AM
Try this one display username (http://www.zubrag.com/forum/index.php/topic,318.0.html)