Page 1 of 1

Using Session ID's for tracking purposes

Posted: Sun Mar 07, 2004 1:33 pm
by BigMC22
Hello,
I am new to the boards and need some help. Here is what I am trying to do, and not having much luck finding the answer on my own:

-User signs up and a member ID is stored in a MySQL database
-When they login to my site I would like that person's member ID to be used as the session ID
-I also need that ID to be added to all clickable URL's and banners on the site for tracking purposes

What is the best way to do this. I would imagine it has something to do with using SID as a place holder in the URL's but does this work and how do I get the SID to be what the user's member ID is?

Any help would be greatly appreciated.

Thanks.

Posted: Sun Mar 07, 2004 2:30 pm
by PrObLeM

Code: Select all

<?php
session_start();
$_SESSION['Session_name'] = $memberid;
?>

Posted: Sun Mar 07, 2004 6:14 pm
by BigMC22
Thanks...Is there anything I need to add to have the $memberid pull from the database for that user when they login? say the database table is called member_info...Thanks again for the help.

Posted: Sun Mar 07, 2004 7:29 pm
by d3ad1ysp0rk
$sql = "SELECT memberid FROM member_info WHERE username = '$username'";
$memberid = mysql_result(mysql_query($sql), 0,0);