I need help echoing a username

Discussion in 'Web Programming' started by skate4life, Jun 15, 2007.

I need help echoing a username
  1. Unread #1 - Jun 15, 2007 at 9:13 PM
  2. skate4life
    Referrals:
    0

    skate4life Guest

    I need help echoing a username

    Ok i'm trying to echo a user name but every time i do this technique it doesnt work.

    <?php
    echo $username;
    ?>

    That doesnt work for me. Some one told me it was because i didnt have any variables to define the meanings. Or w/e it is. So i added variables and all that.

    <?php
    if (!isset($_COOKIE['loggedin'])) die("You are not logged in!<br><a href=login.html>log in</a>");
    $mysite_username = $HTTP_COOKIE_VARS["mysite_username"];
    echo "You are viewing $mysite_username's Profile!";
    ?>

    And it said You are viewing skate4life's profile! When i was viewing some one elses.

    So i need a way to echo some one elses user name. Either echo it from the directory since when they make an account a directory is made after them.
    Or i need to echo it to their page where it stays permanent. Like when you view a post every ones names pop up like mine.. And then when people post it shows their name.

    I need some how where when they register their name will be put on their profile pretty much.

    So i need a code made for the register.php file. So when they register it echo's and puts their name on the profile. But the code cant use the $username thing cause the variable for that is my name the name of my account and it will show my account name.

    Here im sure all that explaining makes no since.. Let me just summarize all this.

    I need a code made to where when some one register's it echo's their name to their profile and it stays put. Any one help?
     
< Help on Setting up a Vb forums | First Python - Key recorder. >

Users viewing this thread
1 guest


 
 
Adblock breaks this site