3 Replies Latest reply on Oct 15, 2006 1:05 PM by MikerRoo

    Getting server IP

    TommyMTL Level 1

      Is their any way to get the server IP where an applications is running. Easy to get remote IP but server one ??? The idea is to create some kind of serialization to prevent the application to run from an unauthorised location.

      Many thanks for any information you can provide.
        • 1. Re: Getting server IP
          MikerRoo Level 1
          Remember that the machine may have more than one IP (especially servers).

          The attached gets all of them.

          • 2. Re: Getting server IP
            TommyMTL Level 1
            This is greate, it kind of work but how do I manipulate this information.

            This is the error code I am getting trying to evaluate the IP result with a conditional value:
            Complex object types cannot be converted to simple values.

            The expression has requested a variable or an intermediate expression result as a simple value, however, the result cannot be converted to a simple value. Simple values are strings, numbers, boolean values, and date/time values. Queries, arrays, and COM objects are examples of complex values.
            The most likely cause of the error is that you are trying to use a complex value as a simple one. For example, you might be trying to use a query variable in a <CFIF> tag. This was possible in ColdFusion 2.0 but creates an error in later versions.

            <cfif IsDefined ("aHostIPs") and aHostIPs EQ "myLookingIP"> Test passed </cfif>
            • 3. Re: Getting server IP
              MikerRoo Level 1
              You would use:
              <CFIF ListFind (ArrayToList (aHostIPs), "myLookingIP")>
              <h1>Test passed</h1>