This is a discussion on "My Page Statistic [Browser & OS]" within the Classic ASP section. This forum, and the thread "My Page Statistic [Browser & OS] are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
My Page Statistic [Browser & OS]
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
My Page Statistic [Browser & OS]
Hello, since this asp thread is not much thing going on lately, let me make you guys busy for quiet some time!
I have a question. I have notice that there is some discussion in this forum regarding page statistic (their page statistic) and I am really interested to learn how to do that. Ok, I know that I should have a code for checking the user browser and OS:
That would be a long list. Basically, what I am trying to say here is I wanted to create a page in my site that will display all this page statistic info. Something like: My Page Statistic
Thanks..
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
|
|
#2
|
|||
|
|||
|
Re: My Page Statistic [Browser & OS]
what kind on an info do you want to keep?
Basically, the Ip address can be the identifier column for your table and you can keep any user that his IP does not exists on the database. to that very basic 1 column table you will add to each row any other information on the user that you want (you can look for the info on the serverVaraibles list). more advanced, to each row you can add the current date and time and get more specific on your statics (e.g. alltime, last year, last month, last week, today, 5 minutes ago - online). i mean to something like this: http://extremetracking.com/open;unique?login=alexucho if you get troubles i can help. |
|
#3
|
|||
|
|||
|
Re: My Page Statistic [Browser & OS]
Quote:
Ok, I must have a field (to store the IP address of the visitor) in my table... Once they hit my site address, the main page will perform a checking of their IP address, If it exist in the database, continue to surf my site. If it does not exist, save their browser, IP address as well as their OS into my database. Ok, I get it now.. Thanks.
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Last edited by Monie; Oct 29th, 2007 at 03:00. |
|
#4
|
|||
|
|||
|
Re: My Page Statistic [Browser & OS]
Hai everyone,
I've come up with this simple code (but I ended up doing it for the whole day tho..) It basically capture the user info like the type of browser they are using, their server software and the most important thing is their IP address, and store them in the database.
If there is any better way, please share, Thanks..
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Last edited by Monie; Nov 1st, 2007 at 07:19. |
|
#5
|
|||
|
|||
|
Re: My Page Statistic [Browser & OS]
amm, yes you can.
instead of looping all your database you can do it with a simpler query. something like this:
secondly, why are need the redirection for? you can make this code rows as a new page and add it to each page (you can add to the static the current page...). that way, if a user will surf directly to "default.asp" the static will "know" him. and to loss some extra load on your database you will create a cookie (with chocolate's chips), after you adding a new user (by unique IP) or verifying that this user is already in exists in your database, that says 'hi! did i surfed here before?'. and finally you will add the damn question if the cookie exist than do the ip check. good luck m8 :P |
|
#6
|
|||
|
|||
|
Re: My Page Statistic [Browser & OS]
Wow.. Thanks again Eran!
I'll have a look at your way and try them in my page ASAP. I'll let you know if I manage to do it
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
#7
|
|||
|
|||
|
Re: My Page Statistic [Browser & OS]
Hai Eran, I have come up with this! Looks more effective tho..
I never tought of that before.. Thanks to you About the cookie things.. I might learn that bit. I am using session variable in my login page tho..
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
#8
|
|||
|
|||
|
Re: My Page Statistic [Browser & OS]
any time
cookies is a very like the same as sessions except that the cookie is saved only on the user pc and session cost you on the server as well. cookies - unsecured. any website or man or hacker can see it (you can see it on the cookies folder). session - secured. saved on the server. :secret: the thing is that we don't want unnecessary data on the server. it will slow your website down. therefor try to use as slightly as you can with sessions. first, I saw you use redirection and by that users can bypass your static page directly to your main page so i suggest you to put the static code on any page that you want without the redirection thing. second, the cookie thing is to loose stress on the database that when i reload the page it won't connect to the db again for nothing. 3rd, you got this terrific site that can be very useful for ya http://www.w3schools.com/asp/asp_cookies.asp |
|
#9
|
|||
|
|||
|
Re: My Page Statistic [Browser & OS]
you seems good in asp Eran
As you notice, I have throw away the redirect thing and seems that I coded them in a very effective way. About the cookies thing, that I will keep that in mind. Now, everytime the user visit my main page, the page will "rerun" the If Then Else statement. That I have to look into now....
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
#10
|
|||
|
|||
|
Re: My Page Statistic [Browser & OS]
Solved it!
Just add some session checking and the code will no longer be run everytime the page load/refreshed!
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
#11
|
|||
|
|||
|
Re: My Page Statistic [Browser & OS]
i meant u do that on cookies to easier the server.
nice work :P |
|
#12
|
|||
|
|||
|
Re: My Page Statistic [Browser & OS]
yeah, I am learning that now, I mean how to use cookies instead of session object
Thanks for the advice.
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
#13
|
|||
|
|||
|
Re: My Page Statistic [Browser & OS]
and... my final question...!
I am using this code to get the browser type: <%=Request.ServerVariables("HTTP_USER_AGENT")%> = "a long list of browser type here" and in my sql database I will write like this: SELECT * FROM mydatabase WHERE browser = "a long list of browser type here" Is there a way for me to get the result like this: browser = Firefox or EI7 or Safari or IE6.. instead of the long list I get from the code above? Thanks..
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
#14
|
|||
|
|||
|
Re: My Page Statistic [Browser & OS]
nop
Once I copied i file from "webwiz" forum that can do what you want - if you want you can search it on their website... the main idea is to check if IE6 is in the text and to determine the browser type. they got a long list of browser type and versions there. very useful. i suggest you go search or ask for it on there website. gL! |
|
#15
|
|||
|
|||
|
Re: My Page Statistic [Browser & OS]
I would be thankful if you could send me the file that you are talking about
I don't know what to search for Eran.. Thanks.
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
#16
|
|||
|
|||
|
Re: My Page Statistic [Browser & OS]
browser.txt
web_wiz_forums_lite_v7[1].9 i didn't found this on their latest versions so maybe they upgraded this old function :] try to ask them on their community... |
|
#17
|
|||
|
|||
|
Re: My Page Statistic [Browser & OS]
Wow Eran, that code is good!
Brilliant you!
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
#18
|
|||
|