简体   繁体   中英

Getting the remote address from a <script> tag

I have a page with a <script> tag in it pointing to a PHP script that generates JavaScript.

In this PHP script, I verify the remote IP to see if this IP has the right to use the script.

My question is: how do I get the IP from the machine that embeds the <script> tag?

In $_SERVER , I have REMOTE_ADDR which is my IP address (the client) and SERVER_ADDR which is the IP of the machine that runs the PHP script that generates JavaScript (the server).

But in between those, there's the page that embeds the <script> tag and I need its server IP address.

Any ideas about how I'm gonna find it?

Thanks

I have a page with a <script> tag in it pointing to a PHP script that generates JavaScript.

In this PHP script, I verify the remote IP to see if this IP has the right to use the script.

My question is: how do I get the IP from the machine that embeds the <script> tag?

In $_SERVER , I have REMOTE_ADDR which is my IP address (the client) and SERVER_ADDR which is the IP of the machine that runs the PHP script that generates JavaScript (the server).

But in between those, there's the page that embeds the <script> tag and I need its server IP address.

Any ideas about how I'm gonna find it?

Thanks

I have a page with a <script> tag in it pointing to a PHP script that generates JavaScript.

In this PHP script, I verify the remote IP to see if this IP has the right to use the script.

My question is: how do I get the IP from the machine that embeds the <script> tag?

In $_SERVER , I have REMOTE_ADDR which is my IP address (the client) and SERVER_ADDR which is the IP of the machine that runs the PHP script that generates JavaScript (the server).

But in between those, there's the page that embeds the <script> tag and I need its server IP address.

Any ideas about how I'm gonna find it?

Thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM