Jump to content

[SOLVED] Advice on whos visited your profile


graham23s

Recommended Posts

Hi Guys,

 

I was wondering if any of you guys could advise me on the best way to do this:

 

i was wanting users on my site to see the last 5 or 10 users that had visited there profile, what would be the best way to do this, (i'm not asking for code unless you have it lol) just the "do this, do that" kinda thing.

 

thanks guys

 

Graham

Link to comment
Share on other sites

are they going to be other users? if so... storing their userid's to the database... say "12324|324|2121|4352|435"... then explode, and grab usernames from database... are your best/fastest method i would say :-)

Link to comment
Share on other sites

personally... i wouldnt make a new table for just that... i'd probably set it right into the table which controls those webpages :-)... once you have the id list...

$list=explode('|',$row[lastusers]);
foreach($list as $v){
$query=mysql_query("SELECT `name` FROM `users` WHERE `id`='$v' LIMIT 1");
$row=mysql_fetch_array($query);
$lastusers[]=$row[name];
}

 

you could instead store the name into the table... however i like stuff being automatic(if they changed names, etc)... thats just me tho :-)

Link to comment
Share on other sites

If I was going to do this I would just record all the request data for each http_request along with the users information, the profile page for each user will have a unique url, something like ?profile=name so you can just search through the logs and pay attention to the user_ids in the result.

 

 

 

 

 

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.