How to detect the visitor's IP address using HTML?

前端 未结 6 764
暗喜
暗喜 2020-12-29 13:59

How can i detect the visitors IP Address using HTML for my website? I have a contactform.html and a formsent.html. And when formsent.html sends the contact info to my email

6条回答
  •  死守一世寂寞
    2020-12-29 14:36

    You can't do it through HTML. However, you can find the IP address of a visitor through PHP.

    $ip=$_SERVER['REMOTE_ADDR'];
    

提交回复
热议问题