ServersIP Addresses Page 4

IP Addresses Page 4




Creating the link is as simple as reading the address file and
writing the address out!

set FileObject =
server.CreateObject(“Scripting.FileSystemObject”)
in_file =
“addr.ip”
temp =
SERVER.MAPPATH(REQUEST.SERVERVARIABLES(“PATH_INFO”))

‘get the current directory
i =
len(temp) – 1
j = i
done = 0
do while done =
0
    if mid(temp,i,1) = “”
then
        FTP_PATH =
MID(TEMP,1, i)
        done =
1
   else
       i =
i – 1
       if i = 0
then
         done =
1
      end if
  end
if
loop

file_name = FTP_PATH & in_file ‘ create the full filename with path
on
error resume next
Set InStream= FileObject.OpenTextFile
(file_name, 1, False, False)

if err.number 0 then
   response.write
(“Sorry, Bobs dynamic link server is not up”)
no file to read

else
   address =Trim(
InStream.Readline )
   my_time =Trim( InStream.Readline
)
   if address = “OUT” then ‘ OUT
means we have signed out

     
response.write (“Sorry, dynamic link was signed out ” & my_time
& “
“)
      response.write
(“I am probably still at work, try again later”)
else

   %>  ‘ we have a good
address at this point so create a link

<a href="http://”>A dynamic link: up since
 
END IF
END IF
%>

It’s that easy!

 

Latest Posts

Related Stories