Need Help Making Program to Record Traffic Stats

This is a discussion on Need Help Making Program to Record Traffic Stats within the C++ Programming forums, part of the General Programming Boards category; Hi, first of all, let me say I do not have an extensive knowledge of c++. I only know how ...

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    2

    Need Help Making Program to Record Traffic Stats

    Hi, first of all, let me say I do not have an extensive knowledge of c++. I only know how to make programs in a console window. I took it for 1 year in high school and have worked with it very little since then.

    Anyway, I need to write a program in c++ that will track the country any given page is being viewed from and store the data for later processing (preferably on a database running on MySQL).

    Now, I'm not asking that someone write the program for me but I do wish to be pointed in the right direction.

    First of all, I have absolutely no clue how c++ works in terms of the internet as opposed to a basic console window. Do I still write main(), do I need a a special compiler for it to be displayed on the internet (currently using Dev c++).

    Basicly, I need to know what the major differences are between programming for a console program as opposed to the internet. Are there any specific things I need to look out for that could cause me much grief later?

    Also, in terms of the program itself, how should I structure it? Would I require more than 1 file to write it, any special libraries I should know of, etc.

    Anyway, I realize this is a pretty general question so it may be hard to answer, but any help is greatly appreciated. Thanks a lot

  2. #2
    Registered User
    Join Date
    Apr 2003
    Posts
    2,662
    Hi,

    I'm interested in the answer to your question because I'm not aware of a good way to use C++ for web programming. As far as I know, most web programming is done with PHP(easy to learn, small to medium websites) or Java(difficult to learn, large websites).

    Also, I'm not sure you will be able to determine what country someone is viewing from. ip addresses don't necessarily correspond to an isp in the same country someone is viewing your page from.
    Last edited by 7stud; 11-02-2005 at 05:36 AM.

  3. #3
    ^ Read Backwards^
    Join Date
    Sep 2005
    Location
    Earth
    Posts
    282
    You could make a program. Or you could just look in the server access log, maybe make a script to copy it in a special location.
    Or you could just get one of the many “webcounters” services, they do all that you said and much more.

  4. #4
    Registered User
    Join Date
    Nov 2005
    Posts
    2
    Well, I don't want to get one of those webcounters partly because I want to know how everything works within the program so I can make changes as needed whenever I want.

    Also, how would I be able to get a c++ program to work online. I mean, I'm sure I can't just upload a .cpp file and have it work on someone else's computer can I?

  5. #5
    Registered User
    Join Date
    Apr 2003
    Posts
    2,662
    Hi,

    Quote Originally Posted by Xell
    Well, I don't want to get one of those webcounters partly because I want to know how everything works within the program so I can make changes as needed whenever I want.

    Also, how would I be able to get a c++ program to work online. I mean, I'm sure I can't just upload a .cpp file and have it work on someone else's computer can I?
    You have to realize how the web works: there is a server and there is a client. When I am at my computer requesting web pages like Google, I am the client, or more properly: my web browser is the client. My browser sends requests to the server for web pages. The server finds the pages and sends them back to my browser, which displays them.

    When my browser makes requests for web pages, not only does the server look for the web pages my browser requests, the server can also execute some code contained on those pages, like php code or java code. When the php code or java code gets done executing, the result will be a page with pure html or a combination of html and Javascript. Javascript is code that the browser understands and can execute after it receives the page from the server. Once my browser receives the page, it executes any Javascript and then displays the html page.

    I think there is some way to get a C++ program to execute on the server after a client browser makes a request for a web page--maybe through Perl--but I'm not sure how. A lot of commerical web hosting sites are set up to execute php contained on a requested web page, and others are setup to execute java code contained on a requested page.
    Last edited by 7stud; 11-05-2005 at 04:50 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help making a program keep going.
    By ashinms in forum C++ Programming
    Replies: 2
    Last Post: 02-03-2009, 10:12 AM
  2. Client-server system with input from separate program
    By robot-ic in forum Networking/Device Communication
    Replies: 3
    Last Post: 01-16-2009, 03:30 PM
  3. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 05:14 AM
  4. BOOKKEEPING PROGRAM, need help!
    By yabud in forum C Programming
    Replies: 3
    Last Post: 11-16-2006, 11:17 PM
  5. behind and confused
    By steviecrawf in forum C Programming
    Replies: 1
    Last Post: 11-09-2001, 12:51 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21