How do i detect the IP address of the one thatâs visiting my web-site? Is there a way? Please help
you canât do it in flash on its own, youâll need a little PHP or ASP.
With php the command is:
$HTTP_SERVER_VARS[âREMOTE_ADDRâ]
let me know if you need more info
Whatâs the differnce from the loadSound(path,value)? If value is true or false? Does it make a differnece and what is the most reccomended on the internet?
if you have value set to true, the sound you load will stream. That is the sound will begin playing before it has finished loading. If you have the value set to false flash waits for the sound to load completely before it begins playing it.
Its useful to have it set to true for large/long sounds as you wonât have to wait ages while the whole file is downloaded for it to begin playing
Thanks a lot for everything, and are you sure thereâs no way of detecting the Ip-address in Flash MX?
yeah 100% sure
Ok, thanks, but i donât have PHP where can i get it?
PHP is a free language, but it isnât much good to you as it needs to be installed on your server. Check with your site hosts to find out if they have it installed on your server. Anyone can write a php script, all you need to do is create a new textfile and change its extension from .txt to .php and then open it up in notepad or similar. This is the php script thatâll return a users IP for you:
<?
print "IP=$HTTP_SERVER_VARS["REMOTE_ADDR"]";
?>
save this to a file called IPReturn.php
if you create a new flash movie with a dynamic textfield on the stage with variable named âIPâ. In the first frame put:
this.loadVariables(âIPReturn.phpâ);
now if you upload your movie and php script to a web server with php installed when you access the movie itâll display your IP address in the dynamic textfield
if you want an introduction to php try posting in the Server-Side/Scripting forum for expert advice
Thanks a lot, when i finish my web site- in about a month, please come: www.NikiniWebDesign.go.ro, it will be made in flash mx, aniway, now, can you please help me on how to save that ip into a text file and later to check for it in the same text file
you can save ipâs to a textfile with php. This is the script to do it:
<?
$filename = âLog.txtâ;
$fp = fopen($filename, âaâ);
$IP = $_SERVER[âREMOTE_ADDRâ];
$DateStamp = date(âF j, Y, g:i aâ);
$Log = $HTTP_SERVER_VARS[âREMOTE_ADDRâ] . " visited on " . $DateStamp . "
";
fputs($fp, $Log);
fclose($fp);
?>
which saves each visitors IP and the date and time (according to the server) to a text file called Log.txt, to run this script from flash youâd use loadVariables or loadVariablesNum as before
Ok, thanks a lot, now please tell me how do i check if an ip has came before? and if you please, can you please tell me the whole code to write and where to write?
thereâs an easier way to detect if someone has visited before, and that is to use a sharedObject which works like a cookie, saving a small file on the users computer.
Put this script in the first frame of your movie:
Cookie = sharedObject.getLocal("VisitCheck");
if(Cookie.data.Check) {
// this code is executed on revisiting the site
}else {
// this code is executed on the first visit
}
_root.Cookie.data.Check = true;
_root.Cookie.flush();
hope this helps
You have just become my best friend, thanks a lotâŚ, if you need some help and i can possibly help you then tell me howâŚ
heh heh, no problem
glad I could be a help
God, thanks a lot, i tested the code, and it works, how can i save for the new users a name and if they visit again they already have a name
you can save anything you like to the sharedObject, all data is accessed through the data method:
if you had a variable âNameâ that the user has entered their name into you would save it to the cookie like this:
// note the cookie has already been loaded using
// Cookie = sharedObject.getLocal("VisitCheck");
Cookie.data.Name = Name;
and recalling it is just as easy:
SavedName = Cookie.data.Name;
if no name has been saved SavedName will be set to undefined
sorry, when I do what you has said, the php file doesnât work --> the flash file doenât work too
It erro:
Parse error: parse error, unexpected â"â, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /usr/local/psa/home/vhosts/u2u.us/httpdocs/portal/counter.php on line
http://www.u2u.us/portal/counter.php
how do I fix it ? thanks
ok, well the php really doen not work, itâs true, but the flash thing works, really doesâŚbut iâm till searching for a method to detect the ip address directly from flash, there simply has to be a way⌠i think
hix, it doesnât work too, http://www.u2u.us/portal/counter.swf
can I get your sample source please ?