Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • In addition, you will probably also want to store their current location on the website. You can find that by looking at $_SERVER['REQUEST_URI']. Commented Jan 18, 2014 at 11:22
  • I am not sure about one think. OK, i need to create a database where i will store the data (the IP address and/or the location of connecting users), but how will i tell the database to store all the values? I mean do i need to loop through somehow through the $ip = $_SERVER['REMOTE_ADDR'] to get all the values from it and than store them seperatly? I am a bit confused Commented Jan 19, 2014 at 8:32
  • 1
    "how will i tell the database to store all the values" — Each time someone visits the page, you store the IP they used to visit it. Commented Jan 19, 2014 at 15:55
  • 1
    "do i need to loop through somehow through the $ip = $_SERVER['REMOTE_ADDR'] to get all the values" — No, the visitor's request will only be coming from one IP, so there is nothing to loop over. Commented Jan 19, 2014 at 15:56