PDA

View Full Version : Script for IP


spydude006
10-27-2002, 07:51 PM
Hi,
I have a script for showing IP address in .cgi format
but if i save that file in .asp the code is not working,
So can anybody help me by giving a IP address code in .asp?
Thanks for helping

whammy
10-27-2002, 11:20 PM
<%
ip = Request.ServerVariables("REMOTE_ADDR")
%>

:)

spydude006
10-28-2002, 04:40 AM
Hi

the given .asp code is not functioning.
like,if i put the code in a .asp file,the file just opens to be white[plain], so text , no IP display nothing..

whammy
10-28-2002, 05:12 AM
I'm sure it's functioning just fine - but of course it isn't displaying anything, since you haven't told it to.

That was given as an example - nothing is being done with it, it's just being set as a variable.

Try:

Response.Write(ip)

which should have been the first thing you learned in ASP - i.e.:

<%
Response.Write("Hello World!")
%>

...you might want to look up some ASP tutorials on google.com, or search the forums, there are LOTS of links here...

http://www.haneng.com
http://www.liquidrage.com
http://4guysfromrolla.com
http://www.devguru.com
http://www.w3schools.com/asp

are some other good sites to glean information from.