I need help with writing a hit counter in javascript. I am new to weboage design so I really dont know how to go about doing this.
tehgreatmg 0 Newbie Poster
Recommended Answers
Jump to PostRead this.
Jump to PostWhen I access http://localhost/counter.php I get this:
document.write("1 Hits");PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: open(C:\DOCUME~1\c9972442\LOCALS~1\Temp\php\session\sess_ql1eb53bk1s8ohkja7ivd6tb13, O_RDWR) failed: Permission denied (13) in C:\Inetpub\wwwroot\counter.php on line 3 PHP Warning: fopen(counter.txt) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: Permission denied in C:\Inetpub\wwwroot\counter.php on line 23 PHP Warning: fwrite(): supplied argument is not …
Jump to PostThanks MattEvans:
Ah.. I see my mistake. Yes, you need the counter included as a JS File if your HTML page will be cached.
For OP:
I would recommend sending some headers to prevent caching of counter.php.
in counter.php:
<?php // no cache …
All 12 Replies
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
MattEvans 473 Veteran Poster Team Colleague Featured Poster
tehgreatmg 0 Newbie Poster
tehgreatmg 0 Newbie Poster
MattEvans 473 Veteran Poster Team Colleague Featured Poster
tehgreatmg 0 Newbie Poster
MattEvans 473 Veteran Poster Team Colleague Featured Poster
tehgreatmg 0 Newbie Poster
MidiMagic 579 Nearly a Senior Poster
digital-ether 399 Nearly a Posting Virtuoso Team Colleague
MattEvans 473 Veteran Poster Team Colleague Featured Poster
digital-ether 399 Nearly a Posting Virtuoso Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.