Jump to content

Recommended Posts

Cookies would only affect the user browsing, simply create a database. When a user views the page record it in the database. Check how many links the user has visited. If it is 5, delete the first record and record the next. Simple

 

Btw, if this is in the third party section, where is the code you're using?

Edited by ExtremeGaming

Hmm... Hard to say, the OP is quite lacking on details. Could be, now that you've made me aware of it, Jessica.

 

If that is indeed the case: Not going to happen. Unless you are Facebook or Google, and can convince every web developer to put your tracking code on their site.

Christian, are you serious? You actually can't think of a way in PHP to track what links are clicked on your own website? *eyeroll* I do this on my sites, my Wordpress blog does it for me on my blog, etc etc.

 

OP: Please come back and clarify. 

Ah, seems I misread you. :-\

Somehow I managed to read "OTHER sites", not "OTHER people". >< Sorry about that.

 

That said the context of your first post is a bit confusing, as the two previous posts give a (rough) outline of how to track the links the users click on while on his site. Think you could be so kind as to explain it a bit further?

the two previous posts give a (rough) outline of how to track the links the users click on while on his site. Think you could be so kind as to explain it a bit further?

 

Really? No, only one of them does.

 

Cookies would only affect the user browsing, simply create a database. When a user views the page record it in the database. Check how many links the user has visited. If it is 5, delete the first record and record the next. Simple

 

This, except don't delete anything, just store it. We also don't know if the OP wants to record outgoing links as well which would require more work.

 

Just use an array saved in the session, no need to make it more complicated than that.

 

How do you think that would do what I'm describing? It doesn't...

Could probably have explained it in more detail, but this is what I was thinking of:

<?php 

// Quick example, without any error checking.
$_SESSION['links'] = array (
5 => $_SESSION['links'][4],
4 => $_SESSION['links'][3],
3 => $_SESSION['links'][2],
2 => $_SESSION['links'][1],
1 => $_SERVER['PHP_SELF'],
);

Upon re-reading the OP, I think I might have misunderstood him as well. Guess I was more tired than I thought last night. Again, sorry about that.

Thanks guys, as i said i do not know anything about cookies or sessions, so i can't explain in more details :)) soryy :(

But thanks @Christian F for this quick intro, ho to solve this problem.

 

I don't need any out goid links, just the ones that the user click on my website to be shown in a recent activity without the user to be logged in.

Edited by CosminStan
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.