Zubrag.com
October 20, 2019, 11:24:46 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Pass user name to welcome page  (Read 11497 times)
jeff
Newbie
*
Posts: 1


« 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

Logged
PHPwhattt?
Newbie
*
Posts: 2


« Reply #1 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
Logged
jimmyhendrix
Newbie
*
Posts: 1


« Reply #2 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
Logged
zubrag
Administrator
Hero Member
*****
Posts: 788


WWW
« Reply #3 on: November 01, 2010, 11:55:18 AM »

Try this one display username
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC