Frequently asked questions about the Text Counter script.
Text Counter displays plain text, regular Counter uses digit images.
Both scripts track page hits, but display them differently:
| Feature | Text Counter | Regular Counter |
|---|---|---|
| Display | Plain text numbers | Graphical digit images |
| Speed | Faster | Slower (loads images) |
| Setup | Simple (no images) | Requires digit images |
| Styling | CSS/HTML | Limited to image design |
| File Size | Tiny | Larger (includes images) |
Check file permissions.
This is usually a permissions problem. The script needs to read and write the data file:
Set to 666 (read/write for everyone):
chmod 666 /path/to/data/count.dat
Directory must be 755:
chmod 755 /path/to/data/
Check the $data_dir variable in the script points to the correct location.
echo "0" > count.datchmod 666 count.datYes, enable comma formatting.
The Text Counter can format large numbers with commas for readability:
$use_commas = 1; # Enable comma formatting
# Without commas: 1234567
# With commas: 1,234,567
Use HTML/CSS styling in the script output.
The Text Counter outputs plain text, which you can style using HTML and CSS:
print "<font color='red' size='5'><b>$count</b></font>";
<span class="counter"><!--#include virtual="/cgi-bin/textcounter.cgi"--></span>
<style>
.counter {
font-size: 24px;
font-weight: bold;
color: #ff0000;
font-family: 'Courier New', monospace;
}
</style>
Questions about graphical counters
Questions about text clocks
Browse all script FAQs