Page counter and ip address recorder.

Posted on 2004-11-19
Medium Priority
Last Modified: 2013-12-12
I am creating a website and i want to create a database that will record the ip address and possibly other details of people that visit my website. i want to have a counter which will count the number of unique visitors to my site. my friend told me i should go about this through php but i dont know too much about how to set up a database on my webserver or to write the code although i have found some bits on the web. how can i create a database on my server and get the page to update it whenever someone new visits it.
Question by:aidanmcg34
  • 4
  • 2

Expert Comment

ID: 12630821
if your using php normally mysql would be the database to use, see if your web hosting company supports that and if so ask them to set it up.

id look at the php.net site it can help you with the basics:
http://au.php.net/manual/en/ref.mysql.php has example of how to connect to a sb and retrieve results from it and display them on a page.


will show you a list of variables you can access to get information about someone visiting your page. in your case you wanted the IP, well that would be by calling $_SERVER["re

Expert Comment

ID: 12630829
(accidently pressed submit)
... would be by calling $_SERVER["REMOTE_ADDR"];


Author Comment

ID: 12631164
the first problem i have is getting a server. i have nowhere to put my site as i cant find a server that wont charge me for hosting php pages and as i only need one for 2/3 weeks there is no point in paying for it.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 12631185
do you have a broadband connection? you could host the site yourself if its just for a few weeks.
if your on a dynamic ip get an account from a company like no-ip.com.

you can install php and mysql on your own computer.


Author Comment

ID: 12631216
will that cost me anything and i just have a 56k dial up but its only for me to view so i can test my php code and the database.

Accepted Solution

jkna_gunn earned 1000 total points
ID: 12631243
no the account from no-ip.com is free i use it myself, you basically get a subdomain from them like {yourname}.no-ip.org that will point to your computer.
a little bit of software you download from them will autmatically update your IP address when it changes.

you will also need to download php, mysql and apache.
install apache first, then php, instructions can be found on the apache site http://httpd.apache.org/
php can obviously been downloaded from php.net (im using 4.3.9).
mysql from mysql.com.

all these come with documentation on how to install.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month13 days, 15 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question