This sounds like an easy question, but haven't really managed it
how do I get the PC/device name and IP address with spiderbasic?
How does one get IP and hostname?
Re: How does one get IP and hostname?
Its not possible neither natuve fuctions neither via javascript
Securicy policy prohibit it
Securicy policy prohibit it
Christos
-
- Posts: 30
- Joined: Wed May 01, 2019 10:14 am
Re: How does one get IP and hostname?
that's a bummer, that is
Re: How does one get IP and hostname?
if you plan to get it on mobile you can use this cordova module: https://stackoverflow.com/questions/393 ... rdova-apps
-
- Posts: 30
- Joined: Wed May 01, 2019 10:14 am
Re: How does one get IP and hostname?
thanks @Fred and sorry for late reply
I have used this for public IP
I have used this for public IP
Code: Select all
;Example code to get the user's public IP address using an external API
Procedure HttpGetEvent(Success, Result$, UserData)
If Success
if UserData = 1
if ParseJSON(0,Result$)
ObjectValue = JSONValue(0)
NewMap Options()
ExtractJSONMap(JSONValue(0), Options())
FreeJSON(0)
debug "JSON: " + Options("ip")
endif
else
Debug Result$
endif
Else
Debug "HTTPRequest(): Error"
EndIf
EndProcedure
HTTPRequest(#PB_HTTP_Get, "https://api.ipify.org", "", @HttpGetEvent(), 0)
HTTPRequest(#PB_HTTP_Get, "https://api.ipify.org", "format=json", @HttpGetEvent(),1)
HTTPRequest(#PB_HTTP_Get, "https://api64.ipify.org", "", @HttpGetEvent(), 0)
HTTPRequest(#PB_HTTP_Get, "https://api64.ipify.org", "format=json", @HttpGetEvent(),1)
Re: How does one get IP and hostname?
very well, just keep in mind that
a this provides EXTERNAL ip not local (dont know know if that you ask for)
also under many systems will be blocked since you cannot access other domains than yours
if you want to get external IP, only guaranteed method is to host a server side script (php for example) in you SAME domain server, and ask this from your script
a this provides EXTERNAL ip not local (dont know know if that you ask for)
also under many systems will be blocked since you cannot access other domains than yours
if you want to get external IP, only guaranteed method is to host a server side script (php for example) in you SAME domain server, and ask this from your script
Christos