I have 2 questions:
- Can I get the current server's ip address from a GSC file somehow?
- If so, can I read a file from external site and check if the ip address in that file is the same as the current server's ip address?
I want to do a function in a gsc which checking if the current server ip is matching with the current server's ip address where is the gsc loaded
For example: I have a file named ip.txt in an external site (http://8.8.8.8/ip.txt) in the ip.txt file I have IP = 2.2.2.2 or just 2.2.2.2 nvm and in the gsc I want to request this file and the ip from this file and if the ip is same as the server ip where is the gsc is loaded then do nothing but if its not the same then just quit the server or something.
I think I can get the file contents withorPHP Code:
fopen
but I'm not sure that I can get the server ip from a gsc file where is that loaded.PHP Code:
file_get_contents