A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: ip logging in flash?

  1. #1
    Senior Member
    Join Date
    Apr 2003
    Posts
    103

    ip logging in flash?

    here's a question... is there a way in flash to read in a visitor's ip address and turn them into values in flash?

    i'm guessing it will involve some java scripting, and i have NO idea how that works... if it's really quite complicated, then er, would some1 care to help a bit?

    thanks in advance

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    You'd need a script on the server to find the IP address, something like PHP or ASP (assuming the server supports it), try this thread

    http://www.flashkit.com/board/showth...hreadid=499605


  3. #3
    Senior Member
    Join Date
    Apr 2003
    Posts
    103
    Originally posted by catbert303
    You'd need a script on the server to find the IP address, something like PHP or ASP (assuming the server supports it), try this thread

    http://www.flashkit.com/board/showth...hreadid=499605

    cool thanks a million~ sort of got the gist of it...
    so~ you would put this :

    <?php
    // get_ip.php
    echo '&ip=' . $_SERVER['REMOTE_ADDR'];
    ?>

    into a file called "get_ip.php", and then put

    getIP = new LoadVars();
    getIP.onLoad = function() {
    trace(this.ip);
    };
    getIP.load("http://www.yourhost.com/get_ip.php");

    into your AS, and that'd be it? (assuming your server supports php)
    so it knows to "run" the php file? or where does it tell the php file to run? me being totally clueless with regards to php or asp or whatever... oh and is there a javascrip that can do this? not?

    oh and i just looked at my host... they don't support php it seems, is there a way to do this with ASP 3.0? or, does anyone know a good free host that supports php?

    thanks for the attention~
    Last edited by S2mega; 12-10-2003 at 09:36 PM.

  4. #4
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    in ASP I think you could use,

    <%
    Response.Write "ip=" & Request.ServerVariables("REMOTE_ADDR")
    %>

    in a script called get_ip.asp

    then this value can be loaded into the movie in just the same way as the PHP is, using the load vars object

    code:

    // as a frame action in your movie
    getIP = new LoadVars();
    getIP.onLoad = function() {
    // once the onLoad event has been called all the variables (in this case just the ip variable) from the file we requested will be loaded
    trace(this.ip); // or display it in a textfield etc
    };
    getIP.load("http://www.yourhost.com/get_ip.asp");



    to use javascript to display the IP Address you need to be able to use server side includes (which might not be allowed on your server),

    http://javascript.internet.com/user-...p-address.html

    this page has a quick introduction to SSI

    http://www.vortex-webdesign.com/help/intro_ssi.htm

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center