Getting IP Address of Machine that is Currently Running the Stack

Mark Schonewille m.schonewille at economy-x-talk.com
Wed Oct 25 10:35:41 EDT 2006


There are several ways to get your IP address, depending on which  
address you need. One possibility is this one-liner:"

   put char 1 to -9 of (last word of line ¬
   lineoffset("<title>",url "http://www.whatismyip.com") ¬
   of url "http://www.whatismyip.com")

Probably you want to split up this line, to get the url first and  
then the ip. Of course, it is much easier, if you have a good cgi  
available. I put one up at http://xtalk.memebot.com/cgi-bin/ip.cgi  
which returns nothing but your public ip address. You can use this  
URL as long as Memebot doesn't complain about bandwidth usage, but  
you should install a cgi on your own server if possible.

Use the following script to get the public IP address in Revolution:

   put url "http://xtalk.memebot.com/cgi-bin/ip.cgi"

You can get your LAN IP address with the following script:

   put hostnametoaddress(the hostname)

and the local IP address of your machine with

   put hostnametoaddress("localhost")

Best,

Mark

--

Economy-x-Talk
Consultancy and Software Engineering
http://economy-x-talk.com
http://www.salery.biz

Get your store on-line within minutes with Salery Web Store software.  
Download at http://www.salery.biz

Op 25-okt-2006, om 15:09 heeft Dave het volgende geschreven:

> Hi All,
>
> How can I get the IP address of the machine that a stack is running  
> on?
>
> Thanks a lot
> All the Best
> Dave




More information about the use-livecode mailing list