You are invited to Log in or Register a free Frihost Account!

Php Tracker in conjunction with MySpace... *sigh*

Ghost Face
Yeah, so I would like to know if there would be anyway for me to capture the friend ID from a person who visits my myspace page. Could I have a script fire remotely from my frih site? Or something to where they would just have to press a button or follow a link.

Thanks. Smile
do you know how to get thier friend ID?
Ghost Face
Lol, no. That's why I'm asking. Heh. But, I have an idea of how I would I just don't know if it's possible.

1st - Is there a way to capture the url from where the visitor came from? For example: Let's say I was at and then I went to Is there a way I would be able to tell that they came from ?

2nd - I noticed that on MySpace, the friend ID is at the very end of the URL usually (unless it's followed by random characters Evil or Very Mad ) Is there some sort of function that would let me take off the last 7 to 8 characters on a string and put it into a variable?

Much thanks

__Ghost Face

Edit: Ok, I found something.. $_SERVER["HTTP_REFERER"]
How would I use this? I also found something talking about getenv() but it wasn't specific at all. Help?
1. you're right $_SERVER["HTML_REFERER"]

2. can you post an examle url (including the id) a assume you can use url[-8:]
Ghost Face
Ok. Here's a sample url.

So how would I get 44910852 from it?

Ok, I don't know if you can do this in Php but this is how I would do it in VB. I'd get the string and count over 8 spaces from the right. Then, since some friend IDs only have 7 numbers, I'd use something to remove everything that's not a number.

Does anyone know how'd I'd be able to do that in Php?

Much Thanks.

__Ghost Face

Edit: I just realized that the friend ID doesn't always come at the end of the url because sometimes there are all those random characters at the end and crap (depending on how you viewed the user's page).

Would it just be easier instead to search the string for 7-8 numbers that are in a row? Is that possible?
you could get that by using the variable $_GET['friendid'] really simple Smile
You realise though that that friendid is the id of the firens profile your visiting not of the user himself Wink
Check to see if there is a cookie with the users id
Ghost Face
How would I check on that cookie thing you're talking about?

Yeah, but how does MySpace know that when you leave a comment on someone's page that it's coming from you? They must already have a tracker of some sort already built in. How else would they make your picture and name link back to your profile?
Related topics
myspace code problems
the 9/11 truth
PhP for morons like me?
30frih for a php rotator script
Myspace link codes?
PHP and cookies. Simple problem.
CSS for making images go through a php code.
My website has been hacked
Zen Cart users - PHP 5.2 will become a minimum requirement.
PHP Myspace Scripts
PHP Redirection Varible Folders (That dont exsist)
Costume made Myspace or yuwie Layouts
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

© 2005-2011 Frihost, forums powered by phpBB.