Jump to content

Trying to create simple membership card.


alig8r

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.