Adding User Data To Login Pages

Discussion in 'Customization & add-ons' started by jcary, May 18, 2003.

  1. jcary

    jcary Guest

    Hey Alex,

    I know in other posts you pointed out that to add, for example, the user's name once they are logged in to use the code:
    Code:
    <? 
    session_start();
    print "Welcome, " . $_SESSION['_amember_user']['name_f'] . " " . $_SESSION['_amember_user']['name_l'];
    ?>
    I tried including that and received the following error:

    Code:
    Warning: Cannot send session cache limiter - headers already sent (output started at /site/public_html/List/casting.php:9) in /site/public_html/List/casting.php on line 110
    Welcome, Jay Smith
    But if you notice, it still outputed the name! How can I fix that error?
    Thanks.

    Josh
  2. jcary

    jcary Guest

    Never Mind! I figured things out myself with a little adjusting and tweeking the code. I got what I needed to get.

    Thanks (great script!).

    Josh
  3. syan

    syan aMember Pro Customer

    Joined:
    Apr 6, 2003
    Messages:
    39
    mind posting the final code? is it possible to call this function on an html site using java?
  4. jcary

    jcary Guest

    Hi Syan,

    Sure, I'll post the code, but I'm not sure about calling the function on an html site using java. I have a .php page and this code get's the users forstname to appear.

    First, this code must be placed at the top of the file, even before the opening <html> tag:
    Code:
    <?
    //user must be authorized in aMember when he access this page
    session_start(); // need to be called once
    print $_SESSION['_amember_user'][''];
    ?>
    That doesn't print anything but for some reason it's required. Now, wherever you want the first name to appear, add:
    Code:
    <?
    session_start();
    print $_SESSION['_amember_user']['name_f'];
    ?>
    That should do it.

    Josh
  5. neilhedley

    neilhedley Guest

    Here's the ultimate newbie question:

    How do I customize the font that appears when I print that user's name?

    Thanks
    --N
  6. abbeyvet

    abbeyvet New Member

    Joined:
    Feb 2, 2003
    Messages:
    135
    Just wrap your HTML around that code.

    eg

    <b> <?
    session_start();
    print $_SESSION['_amember_user']['name_f'];
    ?> </b>
  7. Carmilla

    Carmilla Guest

    This is helpful, at least to know that it IS possible to put some user data on the member page. But what if you want some other info? It would be great to greet them by name, but I'd also like to show them the contents of the "street" field -- I've pre-empted it, and have them put a URL in that spot, and I need for them to be aware of what they've entered there so they can email me if it changes -- I'm going to implement another little script to go to all these URLs, and check to make sure MY link is there.

    So how do I go about putting the contents of the "street" field into the member page? Putting this info into the page is clearly a much more intimidating process than I had guessed it would be, but I know so little about php and how it works/talks to MySQL. :(

    any help will be appreciated...
    Carmilla
  8. alex-adm

    alex-adm Guest

    just contact us for help.

Share This Page