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?
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..
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
No need to do it in flash, just do it on your server in php "$ip=@$REMOTE_ADDR;"
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.
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'])?> };
well i think im in the same situation, where i want to restrict my swf to run only in a specific IP. if i get the ip in php and pass it as flash vars then it would not protect my swf. in that case, we really have to get IP using actionscript alone.
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):