//ipX
This tutorial shows you how to build a flash file which will show the user their IP address which they are connecting on.
//Preview
//ActionScript Code
///////////////////// Start ////////////////////////////
//crossdomain
Security.loadPolicyFile("http://localhost/crossdomain.xml");
System.security.allowDomain("*");
System.security.allowInsecureDomain("*");
//feildVars
hdrTxt.text = '//ipX_';
resTxt.text = 'loading ...';
//dataLoad
var dataX = this
varReceiver = new LoadVars();
varReceiver.load("http://localhost/ip.php");
varReceiver.onLoad = function(){
dataX.resTxt.text = "ip address: " + this.ip + "\n";
trace("ip address: " + this.ip + "\n");
};
//
stop();
///////////////////// End ////////////////////////////
//PHP Code
///////////////////// Start ////////////////////////////
$ip = getenv('REMOTE_ADDR');
$ip = "&ip=".$ip."&";
echo $ip;
///////////////////// End ////////////////////////////
//Sample files
http://3l3373.com/dl/tutorials/ip/ipX_.rar
//Additional info
crossdomain guide (http://3l3373.com/blogz0r/2007/08/crossdomain-guide.html).
//Preview
//ActionScript Code
///////////////////// Start ////////////////////////////
//crossdomain
Security.loadPolicyFile("http://localhost/crossdomain.xml");
System.security.allowDomain("*");
System.security.allowInsecureDomain("*");
//feildVars
hdrTxt.text = '//ipX_';
resTxt.text = 'loading ...';
//dataLoad
var dataX = this
varReceiver = new LoadVars();
varReceiver.load("http://localhost/ip.php");
varReceiver.onLoad = function(){
dataX.resTxt.text = "ip address: " + this.ip + "\n";
trace("ip address: " + this.ip + "\n");
};
//
stop();
///////////////////// End ////////////////////////////
//PHP Code
///////////////////// Start ////////////////////////////
$ip = getenv('REMOTE_ADDR');
$ip = "&ip=".$ip."&";
echo $ip;
///////////////////// End ////////////////////////////
//Sample files
http://3l3373.com/dl/tutorials/ip/ipX_.rar
//Additional info
crossdomain guide (http://3l3373.com/blogz0r/2007/08/crossdomain-guide.html).
Labels: flash, Flash IP Address, IP Address, php
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home