Jump to content

Recommended Posts

Is it possible to pull the cookies of a viewers browser when you are using a php script to track them on your site and return the info to a stats page, just as it would be done using javascript?

 

If it sounds like I don't know what I am talking about, it's because I don't. I am a novice at best. I am running a stats script on my server and using it to track the stats of individuals that view my site page that I have the code snippet on that returns the info back to my stats page. I have done this my embedding the url to the .swf file that pulls that stats in my sites page. Well, it's not an actual .swf file. I have the .htaccess file set like this

 

RewriteEngine on
RewriteRule image.swf image.php

and inside the image.php file is this

 

<?PHP
$lvc_include_dir = 'include/';

    include($lvc_include_dir.'new-visitor.inc.php3');
?>

 

I am wondering if it is possible to retrieve the cookies as well using php scripting... Either the cookies of my site or of another site that are saved to the viewers computer...

 

Please let me know if this is at all possible..

 

~Chris

The nature of cookies is that you can only view and access the ones that were created from your site.  To create cookies from PHP, you will need the setcookie or header function, and to access them, you can use the $_COOKIE global variable

 

Ok, I guess that what I am really trying to get at here is this... I bought a domain several months back for the sole purpose of housing a statistics script, that does exactly that; it sends back information about the viewers of my various sites. This script itself is rather unconventional, as I have recently found other scripts that show much more information, such as phpMyVisites and Trace Watch, two wonderful open source stats scripts that I would suggest to anyone. However, I continue to use the original script that I had found, but only to capture the viewers IP address, which neither phpMyVisites nor Trace Watch do.

 

So, moving along... The reason I have come to post this today is this; I have recently found that this php stats script that I have (the unconventional one) has proven to be pretty good for tracking the IP's, the ISP's, and the browsers of the people who view my myspace page... Yes yes I know, myspace!! What a joke, but I do have one. What I am trying to accomplish here is to be able to also return the viewers primary myspace photo, a URL to the viewers profile page, or maybe just the users myspace ID and I will handle the rest. But, at this point I would just like to be able to better know who each person is, rather than just having their IP address... I though that this might be done by retrieving the cookies that mayspace generates. Would you happen to have a better suggestion for me?

 

~Chris

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.