LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-10-2006, 05:03 PM   #1
genderbender
Member
 
Registered: Jan 2005
Location: US
Distribution: Centos, Ubuntu, Solaris, Redhat
Posts: 396

Rep: Reputation: 31
echo current user with PHP


I want my website to display, via echo the currently logged on user. So for example if someone logs with the username John, on the following page I would like to echo "Hello John". I know this is possible with cookies but it seems insecure, is there an easier way.

Thanks for the help guys


Also, I should post this in a different post really but is it possible to use a similar command to display all users currently logged onto the website (obviously this ability would only be give to a root user who will have higher level abilities than standard clients).
 
Old 05-10-2006, 06:03 PM   #2
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
For the first one use Sessions. For the second write the logged on users to a file along with their last access time (therefore ignore those beyond a certain time)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
No echo for user id when logging in LORDL Linux - General 1 07-28-2005 12:21 PM
echo user password outspoken Linux - General 4 02-17-2005 05:36 PM
echo does not work in php code suchi_s Programming 3 10-21-2004 03:39 AM
using 'echo' in a system statment in php evilchild Programming 3 09-23-2004 02:27 PM
Updating php 4.3.1 from tar and keeping current php configuration with mandrake 9.1 mrjeep Linux - General 0 04-02-2003 07:50 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration