Find the answer to your Linux question:
Results 1 to 6 of 6
I need some help on expanding a java script. The current script ip displays in title bar is: <script LANGUAGE="JavaScript"> var ip = 'logged for Security' window.defaultStatus = "Your IP ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    flw
    flw is offline
    Linux Engineer
    Join Date
    Mar 2003
    Location
    U.S.A.
    Posts
    1,025

    java script assistance


    I need some help on expanding a java script.

    The current script ip displays in title bar is:

    <script LANGUAGE="JavaScript">
    var ip = 'logged for Security'
    window.defaultStatus = "Your IP address is "+ip;
    </script>

    How can I make this the ip of the requestor and write it to a text file?
    Dan

    \"Keep your friends close and your enemies even closer\" from The Art of War by Sun Tzu\"

  2. #2
    Linux Guru
    Join Date
    Apr 2003
    Location
    London, UK
    Posts
    3,284
    IMO javascript is the r00t of ALL EVIL. What works on one brower, most proberly will not work in another.

    Javascript is client side, that means it is the browers responsibility to execute the code on the client machine, it will not be executed server side.

    Does your host have PHP support? PHP is a server side language, when a page is requested, the PHP code is executed on the webserver.

    Jason

  3. #3
    flw
    flw is offline
    Linux Engineer
    Join Date
    Mar 2003
    Location
    U.S.A.
    Posts
    1,025
    Yes it does support php.

    I know little of java script and nothing of php. I don't want to be a programmer or web designer, just want a way of tracking web access users by ip with a time/data stamp redirected to a txt file so if I were to change hosting services I don't loose the data.

    As far as not working on all browsers you are correct. Currently only supported on the current IE/Netscape/Opera browsers and past several versions of them but not Mozilla. A php solution would be better for browser suppprt and hosting service feaature. I was playing with javascript since I at least knew a touch of it but nothing of php.

    Source of all evil ? So would that include CF as well

    So any script solutions in php?
    Dan

    \"Keep your friends close and your enemies even closer\" from The Art of War by Sun Tzu\"

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru
    Join Date
    Apr 2003
    Location
    London, UK
    Posts
    3,284
    it seems like your trying to reproduce the apache access logs? They have all the information like IP, Date/Time, Page etc etc

    Cant your host just supply the access logs to you?

    Jason

  6. #5
    flw
    flw is offline
    Linux Engineer
    Join Date
    Mar 2003
    Location
    U.S.A.
    Posts
    1,025
    Yes they could but if they were to go under (One man show) and I don't have direct access to the dir with the secure.log file. I can only get to see its content via a admin console which isn't setup for me to cut and paste the data out of it.
    Dan

    \"Keep your friends close and your enemies even closer\" from The Art of War by Sun Tzu\"

  7. #6
    flw
    flw is offline
    Linux Engineer
    Join Date
    Mar 2003
    Location
    U.S.A.
    Posts
    1,025
    So does anyone have a site(s) with free php script for ip type functions ?
    Dan

    \"Keep your friends close and your enemies even closer\" from The Art of War by Sun Tzu\"

Posting Permissions

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