Get IP address using Action Script?

Is it possible to get the client's IP address via Flash (swf) Action Script 3, and then transfer it to a php file to save it to the database?

+6
actionscript php actionscript-3 ip-address
source share
8 answers

No need to do this in Flash, just do it on your server in php "$ ip = @ $ REMOTE_ADDR;"

+6
source share

No, the client IP address is not available in ActionScript 3. The recommended approach is to reflect on the server code.

See http://www.actionscript.org/forums/showthread.php3?s=&threadid=20123

+2
source share
function GetUserIP() { var js="function get_userIP(){return java.net.InetAddress.getLocalHost().getHostAddress();}"; var userIPInfo:String=ExternalInterface.call(js).toString(); return userIPInfo; } 
+1
source share

How do I know YES! But I wonder why to do this. You can simply use PHP to get the IP address.

EDIT: There was a study .. Change in my answer. I think there is less opportunity to do this with Flash ..

0
source share

Like the answer above, use PHP (or another scripting language) to pass the IP address as a parameter value to your flash movie and you will get it available at run time.

Another option is to use ExternalInterface to call a server-side PHP script or something similar to return the IP address.

0
source share

As Alex says, pass it through flashvars, but this PHP really should be:

 $_SERVER['REMOTE_ADDR'] 

The json extension is conveniently used to turn off flashes, for example. to go to swfobject:

 var flashvars = { IP : <?=json_encode($_SERVER['REMOTE_ADDR'])?> }; 
0
source share

You can capture the real IP address using Flash ActionScript.

You will believe this after visiting this site (click on the Flash tab):

http://AnalyzeMy.net

0
source share

Despite what the majority says, there is some difference. I used to run a fairly large forum (200k +), and most of the banned participants were eventually caught again when they entered our chat (Flash). Although VB software (using php) will give one IP address (usually through a proxy network), Chat (Flash) will actually provide us with its True IP address. Don't ask me to explain this - I can barely keep up with PHP myself ...

0
source share

All Articles