help need some code that isn't in my html book

  • Thread starter Thread starter whatever
  • Start date Start date
W

whatever

I am looking to make a page that has 2 buttons on it.

Button 1:
Get ip.
It gets my current ip

Button 2:
Go to ftp site.

This button takes the result or gets new results and takes the
requester to the proper ftp site.

Let's use 255.255.255.255 for the example ftp server's ip.

I am not sure if this can be done with html or if this needs to be
done with JavaScript.

The page will be running on the ftp server itself. I have a site set
up with ddns that will allow me to do this.




Basically all of the above is saying "I want a page that will display
the ip of the server the page is running on. Also I need this to be
automatically updated. So I do not need to update everyday (my ip
lease is exactly 23 hours and 59 minutes and 59 seconds.)"
 
First, there is't going to be any HTML that will do this. You'll need to use
some server-side scripting language. You can get the IP address easily
enough through ASP or ASP.Net using:
<% Response.Write(Request.ServerVariables("LOCAL_ADDR")) %> This will output
the local server's IP address to the web page. You could use the same code
to make a link to the FTP site instead of a button by doing something like:

<a href="ftp://<% Response.Write(Request.ServerVariables("LOCAL_ADDR"))
%>">FTP Site</a>
 
Be aware that the IP address you get (unless you have a static IP) will only
be the one give you on that session by your ISP....
 
Back
Top