Getting IP from incoming browser

How do you get that?

What do you mean?

Incoming browser to what? Your site? Your Messageboard?

serverside scripting

ex: using php…

// PHP file named getip.php:
echo “&ip=$REMOTE_ADDR&”;

// flash file, textfield in _root named ‘ip’

Can you do this also with ASP.NET?

What would the script than be like?


Ive never used aspx so I dont know what the scripting is but you can see how easy it is with php, so a little research is sure to show you how.

first place to look

And if you want to assign that string to a variable named ip?? What do you have to do then?

How do you get directly that ip in a variable???

Also the script doesn’t work with a textbox !!!

I’ve managed to get it in a textbox. BUT

This script:

echo "&ip=$HTTP_X_FORWARDED_FOR&"; 

Returns in the box: $HTTP_X_FORWARDED_FOR

Also with REMOTE ==> just the same

How is this possible?

php version:

note: you have to run this off a php enabled server

Okay, I think that’s the problem. How do you enable PHP on the server OR how do you write an ASP script with that variable???

I told you, look on google and find out

The asp.NET script is :

Response.Write(“ip=” & Request.ServerVariables(“HTTP_X_FORWARDED_FOR”))

But how do you get this in A VARIABLE INSTEAD OF A TEXTFIELD???

good to know :beam:

in that script your making a variable called ip, you then assign that variable to be the ip address through aspx. Using flash’s loadVariables command you can load that variable ip into any scope (movieclip) you want. Once its there, its a variable you can use however you want. If you have a textfield with a variable name the same as the variable which is loaded, that textfield displays the variable which is loaded.

in my example I had a textfield in _root with the var ip. Then I used this.loadVariables(“getip.php”) in the timeline of _root. Once that variable ip was loaded it was displayed in the testfield

and try not to yell, its disturbing

How do you enable PHP on the server?

you have to install it.

see for more info.

Did you get the asp version working?? its easy just like the php version.

I made a asp version for you…

it loads the var same way as the php one…

Response.Write("ip=" & Request.ServerVariables("REMOTE_ADDR"))

[edit]by lostinbeta to show code[/edit]

Thanks, i did the same with an ASP.NET file so only renaming your script to .aspx. But it didn’t work. But i think it doesn’t have any advantages to do so.