PHP Visitor counter - PowerPoint PPT Presentation

1 / 5
About This Presentation
Title:

PHP Visitor counter

Description:

PHP Visitor counter – PowerPoint PPT presentation

Number of Views:41
Avg rating:3.0/5.0
Slides: 6
Provided by: capi7
Category:
Tags: php | counter | gifs | visitor

less

Transcript and Presenter's Notes

Title: PHP Visitor counter


1
PHP Visitor counter
  • Similar to doing a counter using Perl
  • Store visitor count in a text file
  • Read the visitor count from the file
  • Increment the visitor count by 1
  • Display the visitor count
  • Write back the visitor count to the file
  • ? set appropriate read/write permissions

2
PHP Fancy Visitor counter
  • Similar to doing a fancy counter using Perl
  • Same as regular counter, and
  • Display the digits in color
  • Or
  • Display a gif for each digit

3
PHP Fancy Visitor counter
  • Need to assess number of digits in visitor count
    so that we can loop through them
  • count 34589 // 5 digits
  • // strlen( string )
  • numberDigits strlen( count )

4
PHP Fancy Visitor counter
  • Need to access each digit
  • // substr( string, startIndex, numOfChars)
  • digit substr( count, 2, 1 ) // 5
  • Also
  • // stringindex
  • digit count2 // not supported by our
    version

5
PHP Fancy Visitor counter
  • numDigits strlen( count )
  • for( i 0 i lt numDigits i )
  • // gifs are named 0.gif, 1.gif, 2.gif,
  • temp substr(count, i, 1).".gif
  • echo "ltimg src \"temp\"
  • height 20 width 20gt"
Write a Comment
User Comments (0)
About PowerShow.com