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... ?> Link to comment https://forums.phpfreaks.com/topic/97867-trying-to-create-simple-membership-card/ 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? Link to comment https://forums.phpfreaks.com/topic/97867-trying-to-create-simple-membership-card/#findComment-500774 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. Link to comment https://forums.phpfreaks.com/topic/97867-trying-to-create-simple-membership-card/#findComment-500912 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. Link to comment https://forums.phpfreaks.com/topic/97867-trying-to-create-simple-membership-card/#findComment-500919 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. Link to comment https://forums.phpfreaks.com/topic/97867-trying-to-create-simple-membership-card/#findComment-501817 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. Link to comment https://forums.phpfreaks.com/topic/97867-trying-to-create-simple-membership-card/#findComment-501822 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.