----- Original Message -----
From: <[EMAIL PROTECTED]>

> I already have a user registration form set up, but now I want to be able
to
> display the last 10 visitors which logged into my site.

What you can do is everytime a visitor logs in, it is captured into a file,
placing the last entry on top of a file, you could then display the last 10
visitors in the following manner :-

{
# this assume your last entry is placed on top of the file.
my $count = 0;
print "The last 10 visitors are as follows\n";
open VISITOR_FILE , '<visitor.txt' or die "$!\n";
while (<VISITOR_FILE>){
         $count++;
         do {print; last;} if $count < 11;
};
close VISITOR_FILE;
};

> The current script:
> ###########################
> sub get_username_now {
> if ($session_username eq "") { print qq~<b><font size="2">Welcome to </b>
<font color="#FF0000">$sitename! </font></font><br>~;}
> if ($session_username ne "") { print qq~

you could use
if ($session_username eq "") { # do your things }
else { # do your things, in this way it is easier to maintain your codes };

> if ($session_username ne "") {
> if ($helptopic ne "") {

> if ($session_username eq "") {
> if ($helptopic ne "") {

this way is better
if ($session_username ne "" and $helptopic ne ""){ #do your stuff here }
elsif ($session_username eq "" and $helptopic ne ""){ #do your stuff here }



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to