|
I am looking to add a hit counter to an Intranet Site and was curious of the best way to do this. The only requirement is that each user should only be counted 1 time per day.
The only page that we need to track is the home page. However, if we could EASILY add a counter to all pages on our site such as adding some code to the footer on our site (which is automatically pulled into all pages through SSI) then we would be willing to do things that way.
Does anyone have any code that might be useful to me?
Chris LaQuerre
Internet Technologies Consultant
|
|
|
|
|
write a function called GetPageCount which simply gets the page count from a database or a file, increment it, and then saves it again. Then return the incremented value. Adding things like IP blocking will simply need some extra work.
Then, you can add this to the SSI and it will start counting.
<%=GetPageCount()%>
|
|
|
|
|
Hi Folks..
Im using multiple forms ie form1 and form2 in my web page(html page) and each of the form submits its values to seperate asp pages.Now after the asp pages process the values i have to comeback top this webpage.
So i use response.redirect and sometimes server.transfer from the asp page to come back the html page.and my question is how do
i avoid the page from being refreshed. i mean my webpage has some pictures(say pic1) in them and they all belong to form1 and they get changed when the user changes it to say pic2.
But now its refreshed becos form2 was submitted and comes back to the html page then my form1 has picture1 while i want it to have picture2..
Do i have to use of ispostback or some propery like that to make the page understand that it has to kind of maintain its state.
Why Need Parking lots in Bars when Drunken Driving is Prohibited
Why Need Parking lots in Bars when Drunken Driving is Prohibited
|
|
|
|
|
You can't avoid a refresh in code. I've used soem trickery in frames to have the browser look like it's not refreshing, but this is a request sent by the browser to the web server and not your page.
In short, you'll have to save the state.
Jeremy Falcon
Imputek
<nobr>"The happy people are those who are producing something; the bored people are
those who are consuming much and producing nothing." - William Ralph Inge
|
|
|
|
|
I have encountered a scenerio where I need the ability to customize a form method="post", but I cannot use this method.
Basically I need to know if it's possible using JScript to generate my own post's without using forms.
I cannot use get (open a new window w/ custom URL created in JScript) too much data.
I also would like to avoid using cookies for transmission of data....is this possible?
Thanx in advance!
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
You'll have to send raw HTTP information directly to the server to avoid using <form ... method="post"> . I would avoid this if at all possible.
You don't need to have visible form elements at all if you are trying to pass a value. For instance...
<form action="something.html" target="_new" method="post" name="frmMain">
<input type="hidden" name="mydata" value="this is so like my data">
<a href="javascript:frmMain.submit();">Clickety</a>
</form> This will send the information without displaying anything but the link (anchor) in the browser.
What is it exactly you are wanting to do? There may be another way. If not, I'll outline some details on using raw HTTP data.
Jeremy Falcon
Imputek
<nobr>"The happy people are those who are producing something; the bored people are
those who are consuming much and producing nothing." - William Ralph Inge
|
|
|
|
|
Just send data in form fields to the server without using form tag, cookies or encoded URL's...
Pushing raw http data is the only way I see available.
How would I go abouts doing this and why would you recommend me not using this approach...so long as I do it correctly is see no worries...???
Thanx again!
Cheers
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hockey wrote:
Just send data in form fields to the server without using form tag, cookies or encoded URL's...
From a web page or from a program? Netscape won't even render form elements unless they are enclosed in form tags. And the default method is GET, so unless you specify otherwise you won't be able to POST the data.
Jeremy Falcon
Imputek
<nobr>"The happy people are those who are producing something; the bored people are
those who are consuming much and producing nothing." - William Ralph Inge
|
|
|
|
|
From a webpage using JScript.
I've used text elements before without wrapping them in form tags in NS6+ and it worked fine.
I find in IE form tag just adds padding and causes alignment issues sometimes...
Plain and simple I hate form tags...
Thanx again!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hockey wrote:
I've used text elements before without wrapping them in form tags in NS6+ and it worked fine.
Yes, but NS 1.x, 2.x, 3.x, and 4.x won't as not using the form tag is improper. NS 6.x renders closer to the way IE does. Test and ye shall see.
Hockey wrote:
I find in IE form tag just adds padding and causes alignment issues sometimes...
That is true, my solution is to place the form tags inside tags that will not render on a web page - like between table data tags.
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<form>
<td>
Put the form elements and other stuff here!
</td>
</form>
</tr>
</table> This will stop the extra crap from rendering.
Jeremy Falcon
Imputek
<nobr>"..." - Paul Watson 07-17
|
|
|
|
|
Jeremy Falcon wrote:
Yes, but NS 1.x, 2.x, 3.x, and 4.x
Holy...your that cross browser friendly...???
I only bother with NS6+ sometimes don't even bother with that...
Anyways...do you know of any method available in JScript for sending raw http data or can this not be accomplished???
Cheers
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hockey wrote:
Anyways...do you know of any method available in JScript for sending raw http data or can this not be accomplished???
Client-side is impossible because HTTP header information is sent to the browser first. This is before any client code is even touched. [edit]To send data to the server via a script you can use a form, stick with GET, or execute a server-side program.[/edit] On the server-side you have to use ASP, PHP, SSI, CGI, a raw HTTP stream, etc. to manipulate the header information (which contains the POST data).
What I don't get is that knowing you can use the form tag to pull this off and stop from the extra stuff from rendering, why do you still not want to use it?
Jeremy Falcon
Imputek
<nobr>"..." - Paul Watson 07-17
|
|
|
|
|
Jeremy Falcon wrote:
What I don't get is that knowing you can use the form tag to pull this off and stop from the extra stuff from rendering, why do you still not want to use it?
Just an idea i've been toying with for an article here on CP...IMO it's super cool...
I'll prolly have to use cookies now tho...
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hockey wrote:
IMO it's super cool
Sounds interesting.
Hockey wrote:
I'll prolly have to use cookies now tho...
Cookies are extremely finicky though and can quicky bring you into a lot of compatibility issues. Be weary of the cookie!
Jeremy Falcon
Imputek
<nobr>"..." - Paul Watson 07-17
|
|
|
|
|
Jeremy Falcon wrote:
Coockies are extremely finicky though and can quicky bring you into a lot of compatibility issues. Be weary of the cookie!
How so...?
I've never experienced compatibility problems with NS or IE using my cookie object. Website persistance
Mind you I haven't really tested hardcore under NS, but who does...with only 10% of the browser market.
I proudly announce NS sux...and suggest all my clients stick w/ IE
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I am looking for a script or component I can on a website I am developing that would allow users of the site to enter content in a textbox, such as I am doing now, and then be able to apply formatting (with WYSIWYG support would be nice) to the text or parts of the text without having to know the required HTML.
For example, on this site if I want to make this word bold, I have to wrap the word bold with 'b' and '/b'. I would like to be able to highlight the word and click bold.
Also, a spell checker would be nice, too.
-DarrenS
|
|
|
|
|
|
Give me your email and I will post a exm to you,a html+DHTML exm
|
|
|
|
|
I need to hide a table and to show it after the page has loaded at a later moment.
Do you know how could i do it?
rechi
|
|
|
|
|
Bogdan Rechi wrote:
I need to hide a table and to show it after the page has loaded at a later moment.
Ok I won't write all your code for you, but here is the general idea.
First you use CSS to hide the TABLE. You will need to do it inline (which is bad, but about your only solution) so that the TABLE is hidden and we don't have to wait for the CSS file to load. Use style="display: none" or style="visibility: hidden" in the TABLEs opening tag. e.g. <table style="display: none"> .
Then you need to give your TABLE a unique ID so that we can reference it. e.g. <table id="tblHiddenTable"> .
Then in your BODY tag you need an ONLOAD event which will set the DISPLAY attribute of the TABLE to inline , this will display the TABLE once the page is loaded. e.g. <body onload="document.all.tblHiddenTable.style.display = 'inline'">
That shows the table once the page is loaded. If you want to display the TABLE even after that a specific time, say 5 seconds later, then you need to use onload="setInterval ('next_frame(document.all.tblHiddenTable.style.display = 'inline')', 5000);" . setInterval basically allows you to fire off a function after a certain number of milliseconds have elapsed.
hope that helps, if not write back.
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
The greatest thing you'll ever learn is just to love, and to be loved in return - Moulin Rouge
Alison Pentland wrote:
I now have an image of you in front of the mirror in the morning, wearing your knickers, socks and shoes trying to decided if they match!
|
|
|
|
|
hi adding to the reply you got to fire of ur event you can use the ie_timer control.its prety easy to use.Write the code to make your table visible in the ie_timer() event ..
Regards
Pradhip.S
Why Need Parking lots in Bars when Drunken Driving is Prohibited
|
|
|
|
|
Hi Folks..
Im using multiple forms ie form1 and form2 in my web page(html page) and each of the form submits its values to seperate asp pages.Now after the asp pages process the values i have to comeback top this webpage.
So i use response.redirect and sometimes server.transfer from the asp page to come back the html page.and my question is how do
i avoid the page from being refreshed. i mean my webpage has some pictures(say pic1) in them and they all belong to form1 and they get changed when the user changes it to say pic2.
But now its refreshed becos form2 was submitted and comes back to the html page then my form1 has picture1 while i want it to have picture2..
Do i have to use of ispostback or some propery like that to make the page understand that it has to kind of maintain its state.
Why Need Parking lots in Bars when Drunken Driving is Prohibited
|
|
|
|
|
Try this in your ASP page:
<%
... ...
'some ASP code
... ...
%>
|
|
|
|
|
hi
any 1 have idea how too use listview or any such control
in asp....
looking forwar dfor reply
tc
|
|
|
|
|
I want to set my page Automatically as the homepage without prompting the user ....i mean when the page is loaded it should be set as the homepage(automatically)
|
|
|
|