PDA

View Full Version : Adding User Data To Login Pages


jcary
05-18-2003, 11:16 AM
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:<?
session_start();
print "Welcome, " . $_SESSION['_amember_user']['name_f'] . " " . $_SESSION['_amember_user']['name_l'];
?>

I tried including that and received the following error:

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

jcary
05-18-2003, 11:58 AM
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

syan
07-03-2003, 08:47 PM
mind posting the final code? is it possible to call this function on an html site using java?

jcary
07-08-2003, 07:46 AM
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: <?
//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: <?
session_start();
print $_SESSION['_amember_user']['name_f'];
?> That should do it.

Josh

neilhedley
08-07-2003, 11:10 AM
Here's the ultimate newbie question:

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

Thanks
--N

abbeyvet
08-07-2003, 02:35 PM
Just wrap your HTML around that code.

eg

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

Carmilla
08-11-2003, 11:20 AM
Originally posted by jcary@Jul 8 2003, 07:46 AM
Hi Syan,

First, this code must be placed at the top of the file, even before the opening <html> tag: <?
//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: <?
session_start();
print $_SESSION['_amember_user']['name_f'];
?> That should do it.

Josh
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

alex-adm
08-18-2003, 05:26 AM
just contact us for help.