Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: Detect Please

  1. #1
    Regular Coder DELOCH's Avatar
    Join Date
    Apr 2006
    Location
    Canada
    Posts
    537
    Thanks
    4
    Thanked 2 Times in 2 Posts

    Smile Detect Please

    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

    thanks

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    You should deffinitely use a server-side application (php, asp....) not Javascript.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    Regular Coder
    Join Date
    Sep 2005
    Location
    Chicago, IL
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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:

    Code:
    document.write("You have came from "+document.referrer+" and you are using "+navigator.appName+" "+navigator.appVersion)
    I'm only telling you how I would do it, not how its supposed to be done. ;)

  • #4
    Regular Coder
    Join Date
    Sep 2005
    Location
    Chicago, IL
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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:

    Code:
    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.
    I'm only telling you how I would do it, not how its supposed to be done. ;)

  • #5
    Regular Coder DELOCH's Avatar
    Join Date
    Apr 2006
    Location
    Canada
    Posts
    537
    Thanks
    4
    Thanked 2 Times in 2 Posts
    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...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •