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
https://forums.phpfreaks.com/topic/97867-trying-to-create-simple-membership-card/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.