roa3
roa3

Reputation: 901

Get IP address using Action Script?

Is it possible to get client IP address through Flash (swf) Action Script 3 and then pass it to php file to store it in database?

Upvotes: 6

Views: 15471

Answers (8)

Mark
Mark

Reputation: 11

Despite what most are saying - there is a difference somehow. I used to run a rather large forum (200k+) and most banned members were eventually caught again once they entered our chat (Flash). While the VB software (using php) would give one IP (Usually through a Proxy/Network) , the Chat (Flash) would in fact give us their True IP. Don't ask me to explain it - I barely get by with PHP myself ...

Upvotes: 0

rzk
rzk

Reputation:

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

Upvotes: 1

Proxylist
Proxylist

Reputation: 1

It is possible to grab the real IP address via Flash Actionscript.

You'll believe it after you visited this site (click on Flash tab):

http://AnalyzeMy.net

Upvotes: 0

Tim Whitlock
Tim Whitlock

Reputation: 1111

As Alex says, pass it in via flashvars, but that PHP should really be:

$_SERVER['REMOTE_ADDR']

The json extension is handy for wrIting out flash vars, e.g. for passing to swfobject:

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

Upvotes: 0

jerebear
jerebear

Reputation: 6655

Like the above answer, use PHP (or other scripting language) to pass the IP address as a param value into your flash movie and you'll have it available at runtime.

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

Upvotes: 0

Alex Mac
Alex Mac

Reputation:

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

Upvotes: 6

Chris W. Rea
Chris W. Rea

Reputation: 5501

No, the client IP address is not available in ActionScript 3. The recommended approach is to have it reflected by server-side code.

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

Upvotes: 2

Chathuranga Chandrasekara
Chathuranga Chandrasekara

Reputation: 20936

As I know YES!! But I am wondering about the reason of doing that. You can just use PHP for get the IP Address..

EDIT : Had a research.. Changing my answer. I think there is less possibility to do it with Flash..

Upvotes: 0

Related Questions