Counter FAQ

Frequently asked questions about the Counter CGI script.

Q1: The counter displays dashes instead of numbers.

Short Answer:

Check file permissions on your data file.

Long Answer:

The counter displays dashes when it can't read or write to the data file. Common causes:

Q2: Can I use custom digit images?

Short Answer:

Yes.

Long Answer:

You can use your own custom digit images. Here's how:

  1. Create 10 GIF images named 0.gif through 9.gif
  2. All images should be the same size (width and height)
  3. Upload them to your images directory
  4. Update the $image_dir variable in the script to point to your images
Example:
$image_dir = "/images/mycounter/";

Q3: How do I reset my counter to a specific number?

Short Answer:

Edit the data file directly.

Long Answer:

The counter stores the current count in a simple text file. To reset it:

  1. Locate your data file (usually in $data_dir/pagename.dat)
  2. Open it with a text editor
  3. Change the number to your desired starting value
  4. Save the file

Q4: Can I have multiple counters on different pages?

Short Answer:

Yes, use different data file names.

Long Answer:

Each page can have its own counter by using a unique data file name. Pass the file name as a parameter:

<img src="/cgi-bin/counter.cgi?page=homepage" alt="Counter">
<img src="/cgi-bin/counter.cgi?page=about" alt="Counter">
<img src="/cgi-bin/counter.cgi?page=contact" alt="Counter">

This will create separate data files: homepage.dat, about.dat, and contact.dat

Related FAQs

Text Counter FAQ

Questions about the text-based counter

Guestbook FAQ

Questions about the Guestbook script

All FAQs

Browse all script FAQs