alig8r Posted March 25, 2008 Share Posted March 25, 2008 Hi there. Linux - Godaddy PHP 4.0 Joomla 1.0.15 with Community Builder 1.1 Windows/Vista Dreamweaver 8 I am trying to create a simple membership card that all my registered members can print out. I have designed the graphic and have it in Dreamweaver and I want to pull the individual users name, id#, city, & province onto the card. I want the card to be available for printout (such as a wrapper in the users toolbox) I am a real newbie to PHP and I'm stuggling with how I tie it to the individual user. (just like when they sign in and the login php pulls the "hello username") Do I do this with "global user"? such as this below? <?php global $user; $me = user_load(array('uid' => $user->uid)); echo $me->profile_firstname .' '. $me->profile_lastname .'!'; etc... ?> Quote Link to comment Share on other sites More sharing options...
Caesar Posted March 25, 2008 Share Posted March 25, 2008 Is the user's profile stored in a database somewhere? Quote Link to comment Share on other sites More sharing options...
alig8r Posted March 26, 2008 Author Share Posted March 26, 2008 Yes, and I know the field names. Quote Link to comment Share on other sites More sharing options...
ohdang888 Posted March 26, 2008 Share Posted March 26, 2008 do you know CSS,.... because then you could postion the information about the graphic... and then you could jsut put <?<?php echo $username ?> <?php echo $date_joined ?> etc. Quote Link to comment Share on other sites More sharing options...
alig8r Posted March 27, 2008 Author Share Posted March 27, 2008 Yes, I know css and have no problem placing the code in the graphic. I just can't seem to wrap my head around how to code it so that when the user that signs into the website will see only HIS/HER membership card. I will try your code. Thank you. Quote Link to comment Share on other sites More sharing options...
ohdang888 Posted March 27, 2008 Share Posted March 27, 2008 dude its really easy... create a session when they log in. $user id = $_SESSION['id']; //connect to db $result = mysql_query("SELECT * FROM `table` WHERE `id`='{$user_id}' ") or die(mysql_error()); $row = mysql_fetch_array($result); And over the card, place echo $row['username'] echo $row['date_jopined'] echo $row['email'] etc. All you need is a simple query. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.