View Full Version : Detect Please

05-02-2006, 07:02 AM
okay, i decided to make myself a website for a tiny company which i will then make official when i hit 16...

it would all be okay but i desire to do this with JavaScript in a table

Hello + IP +, Your last visit was on + lastVisit

on the next line i want it to say

Begin Wish

You have came from + lastWebsite + and you are using + navigator.appName + navigator.appVersion

End Wish

can someone help me code it? i have NO idea how to get the last webpage nor the ip adress, or the last visit


05-02-2006, 07:31 AM
You should deffinitely use a server-side application (php, asp....) not Javascript.

05-02-2006, 07:42 AM
You can't get IP addresses with Javascript and the only way to check when they last visited would be with a cookie (if you were to use Javascript) and they can easily be cleared. But if you wanted to do the rest of the code you could just do this:

document.write("You have came from "+document.referrer+" and you are using "+navigator.appName+" "+navigator.appVersion)

05-02-2006, 08:03 AM
oh yeah, forgot to tell ya that if you get a direct hit (meaning the visitor types the url directly into the window themselevs) then it will be blank space from where they came from. so you prolly better off with something like this:

var referred_from=(document.referrer=="")?referred_from="a new window":referred_from=document.referrer;
document.write("You have came from "+referred_from+" and you are using "+navigator.appName+" "+navigator.appVersion);

the first one that says "a new window" is what will show up if they are a direct hit.

05-02-2006, 10:55 PM
i would but i have a MASSIVE problem installing php, it IS SOO CONFUSING

can someone give me a link to a good guide because the best guide they gave me is the one in high detail called: Installing APache+Php5+MySQL but it had a big problem since i installed Apache, i tried PHP but when i downloaded the files, the dll files were NOT there... plus i did not install anything since it did not tell me to

i would happily do it because PHP can do everything JS can but better... but since i can't i well...can't...