Announcement

Collapse
No announcement yet.

How do I set a URL reference...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How do I set a URL reference...

    ... so if I am local (i.e 192,168...) or if I am on the web somewhere else, my server will properly link a page on one of my other servers?

    I have a web page that displays my video cams from another server. Here is a snippet from the code: (it's inside and I'm only referencing some address
    <pre class="ip-ubbcode-code-pre">
    &lt;applet archive=Inetcam.jar codebase=http://192.168.0.19:8182/inetcam _
    code=InetCAM.class name=Inetcam width=320 height=240 VIEWASTEXT&gt;
    &lt;param name=cabbase value="Inetcam.cab"&gt;
    &lt;param name=archive value="Inetcam.jar"&gt;

    </pre>

    My IP address from the outside is quite obviously different, and so when I serve this page I need to know how to determine what IP address to put there.

    regards,

    GenevaDude

    http://AutomatedHome.org http://genevadude.com http://GoldenBuffet.biz

    #2
    you can get the IP address of the computer you're viewing the page with.
    The following statement will return the IP

    request.servervariables("REMOTE_ADDR")


    Don't know if this helps, but it will help you determine if the viewer is on the local network or not.

    Comment


      #3
      Are you running IIS by any chance? If so you could simply set an application variable to point to you current ipaddress.

      <pre class="ip-ubbcode-code-pre">
      &lt;applet archive=Inetcam_av.jar codebase=http://&lt;%=application("ipaddress")%&gt;:8000/inetcam code=InetcamAVideo.class name=Inetcam width=420 height=340 VIEWASTEXT&gt;

      </pre>

      You could also use a device string to hold your ipaddress and print this in as well.

      <pre class="ip-ubbcode-code-pre">
      ipaddr = hs.deviceString("a16")
      &lt;applet archive=Inetcam_av.jar codebase=http://&lt;%response.write ipaddr%&gt;:8000/inetcam code=InetcamAVideo.class name=Inetcam width=420 height=340 VIEWASTEXT&gt;
      </pre>

      -Rupp
      Why don't they just make mouse-flavored cat food?
      -Rupp
      sigpic

      Comment


        #4
        Something like genevadude.com:8182 should work assuming you are running behind a router. The router would have to be set to send incomming traffic on port 8182 to the 192.168.0.19 computer.
        Why I like my 2005 rio yellow Honda S2000 with the top down, and more!

        Comment


          #5
          Thanks Rupp.
          I didn't think to put in Response.Write! I was trying to put the address in by codebase="thisSession" where thisSession holds the address string.
          Works fine Now!

          regards,

          GenevaDude

          http://AutomatedHome.org http://genevadude.com http://GoldenBuffet.biz

          Comment

          Working...
          X