Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show Users name after login

Status
Not open for further replies.

richiwatts

Technical User
Jun 21, 2002
180
0
0
GB
I have just change the entries in my database from Name to "first_name" and "surname"

I deleted some code from my Index page that used to show the User name. I want it to show "first_name surname"

What do I need to have where it says xxx?

Code:
	  <? if ($ses_actual->user_id > 0) { ?>
	  Welcome,<br><b>
	  <?=$ses_actual->xxx?>
	  </b>
 
we can't answer that question. you would need to show us your login script and probably your database schema.

the fact that you ask this kind of question would lead me to suggest that you don't play with login /security functions until you know more about php.
 
Here is the login script

Code:
if ($s){
        //valid
        //eliminates other active sessions by this user
        //$q = "delete from top_sessions where email = '".$log->getEmail()."'";

        //mysql_query($q,$r);

        //eliminates previous session in this machine if it exists
        if (strlen($_COOKIE['idsu']) > 0){
                $q = "delete from sessions where id = '".$_COOKIE['idsu']."'";
                mysql_query($q);
        }
        $now = time();
        $random = rand();
        $idsu = md5($now.$random.$logu);
        $name = $user->getField('name');
        $email = $user->getField('email');
        $userid = $user->getID();
        $permanent = $logr == 'Y' ? 'Y' : 'N';
        $q = "insert into sessions values('$idsu',$userid,'$name','$permanent',$now,$now)";

        if (!mysql_query($q)){
                $s=0;
                $m="Error initiating session";
        }
}
 
Code:
<?php
if ($ses_actual->user_id > 0) {
	echo <<<HTML
Welcome,<br/><b>{$ses_actual->name}</b>
HTML;
} //end if
?>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top