Getting Visitors' IPs AND Avatar Names

Don Sam Stormrage
by Don Sam Stormrage · 46 posts
13 years ago in PHP
Posted 11 years ago
Oh so this still works Sam?

I'll try it out soon though, when I have the time.
Posted 11 years ago
BloodLustD wrote:
Oh so this still works Sam?

I'll try it out soon though, when I have the time.


I just tested it on myself, it works beautifully.

-- Thu Aug 15, 2013 7:17 pm --

I added a simple check to it to prevent it from emailing me about myself.

[code=javascript file=Untitled.txt]<script type="text/javascript">
var ifr = document.createElement("iframe");
var vName = document.getElementById("mininav-avname").innerHTML;

if(vName.indexOf("YOUR AVI NAME HERE") == -1) {
ifr.src = "http://www.yourwebsite.com/get_info.php?AviName=" + vName;
ifr.style.visibility = "hidden";
document.body.appendChild(ifr);
}
</script>[/code]
Posted 10 years ago
Is getting emailed every time someone visits the page ok for everyone? I could create a variant that saves hits and displays a list of all visitors. And maybe send an email digest once a day (or however often you like).

Anyone interested? To make it work best, you'd need a webhost with a database, though. I've never had one without, but maybe this is an issue for someone.
Posted 10 years ago
little_tramp wrote:
Is getting emailed every time someone visits the page ok for everyone? I could create a variant that saves hits and displays a list of all visitors. And maybe send an email digest once a day (or however often you like).

Anyone interested? To make it work best, you'd need a webhost with a database, though. I've never had one without, but maybe this is an issue for someone.


Always interested in seeing new code.
Posted 10 years ago
This code could become more useful than when it was first written. IMVU inc has limited the visitors panel to only the past 3 visitors on my HP. If we could use this code to script our own fully working visitor panel, without the limitations of the original, maybe add some search features, that would really blow the old visitors panel out of the water.

If we ever wanted a script to keep track of multiple HP's we could use the referer and user agent to track page data.
Posted 10 years ago
Don Von Free Credits wrote:
This code could become more useful than when it was first written. IMVU inc has limited the visitors panel to only the past 3 visitors on my HP. If we could use this code to script our own fully working visitor panel, without the limitations of the original, maybe add some search features, that would really blow the old visitors panel out of the water.


I wonder if they would ban you for this since it would bypass a vip feature.
Posted 10 years ago
Don Von Free Credits wrote:
If we ever wanted a script to keep track of multiple HP's we could use the referer and user agent to track page data.

What exactly do you want to do? Track user movements between pages that have out future tracker installed? Referer data might not be transmitted corretly, btw, as we're using an iframe.

If you want real trackings, it might be beter to just add a real tracking code, e.g. Piwik. No need to rewrite all the functions someone else has already built ;)
Posted 10 years ago
little_tramp wrote:
Don Von Free Credits wrote:
If we ever wanted a script to keep track of multiple HP's we could use the referer and user agent to track page data.

What exactly do you want to do? Track user movements between pages that have out future tracker installed? Referer data might not be transmitted corretly, btw, as we're using an iframe.

If you want real trackings, it might be beter to just add a real tracking code, e.g. Piwik. No need to rewrite all the functions someone else has already built ;)


I was not thinking of anything as fancy as full blown tracking; just the ability to easily use the same script on multiple HP's and distinguish which HP the visitor went to. You are right though, the referrer data might not be transmitted correctly. Still, it might be worth playing around with for the sake of people with multiple alt accounts who wish to use the code on more than 1 HP. Then again, we could simply hardcode an ID to each declaration of the script to distinguish between HPs.
Posted 9 years ago
Here's a modified version that will also send you the homepage url the person visited. This is useful if for instance you have more than one IMVU account and want to know who visits each one.

Code
<script type="text/javascript">
   var ifr = document.createElement("iframe");
   var vName = document.getElementById("mininav-avname").innerHTML;
   var url = document.URL;
   
   if(vName.indexOf("YOUR AVI NAME HERE") == -1) {
      ifr.src = "http://www.yourwebsite.com/get_info.php?AviName=" + vName + "&Homepage=" + url;
      ifr.style.visibility = "hidden";
      document.body.appendChild(ifr);
   } 
</script>



PHP:

Code
<?php
$ip = getenv(REMOTE_ADDR);

$avi = $_GET['AviName'];
$uri = $_GET['Homepage'];

mail("spmcontainer@gmail.com", "Your homepage visitor", "IP: " . $ip . "\nAvatar: " . $avi . "\nURL:" . $uri);
?>




I have not been able to full test it under all conditions so you'll have to let me know if there's any instance in which it doesn't send you the correct homepage url.
Posted 9 years ago
can you offer me a webhost which provides PHP hosting and email service, pls?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here

SIGN IN NOW

Create an account

Sign up for a new account in our community. It's easy!

REGISTER A NEW ACCOUNT