I want to print the user’s IP address in Flash via a PHP script, but keep getting an undefined variable (printed as “undefined”). Here’s my PHP script:
<?php
// Script for getting IP
$yourip = $_SERVER['REMOTE_ADDR'];
echo ("yourip=".$yourip);
?>
And the Actionscript:
// Request user IP via PHP
loadVariables("scripts/getuserip.php", this);
statistics.stat_ip.text = "Your IP address is "+yourip;
statistics.stat.ip.text comes up as “Your IP address is undefined”…
I can tell there’s something blindingly obvious that I’m missing.