All you need to do is change the variables at the top of the page to change how the counter looks.
By : Genshibakudan
<?php
//**********************************//
// My first PHP script! //
// Author: Alex Walton //
// E-Mail: genshibakudan@hotmail.com//
// Date: 26.4.02 //
//**********************************//
/*
Feel free to edit this script as you like but please keep the header (^ ^ ^) intact.
If you have any questions about this script, e-mail me at genshibakudan@hotmail.com
*/
// You can edit the variables below \/
$filename = "count.dat" //name of the file where the data is kept
$message1 = "There have been"; // first message section \/
$message2 = " visitors to this page."; // second message section [$message1 $count $message2]
$bold = "1"; // if 1, the numbers are bold, if 0 nothing is bold
$font = "verdana"; // The font name
$fontsize = "2"; // The size of the font
$textcolor = "#005500"; //The color of the $message1 and $message2 (HEX)
$numbercolor = "#550000"; //The colour of the numbers (HEX)
$numberglow = "0"; //If 1, the numbers glow, if 0, they don't.
$glowcolor = "#0000FF"; //The colour of the glow
$invisible = "0" //If 1, the counter will not show (it will still count!)
// Don't edit anything below this line unless you know what you're doing
$fp = fopen($filename,"r+");
flock($fp,1);
$count = fgets($fp,6);
$count += 1;
rewind($fp);
fputs($fp,$count);
flock($fp,3);
fclose($fp);
if ($invisible == "1"){
//counter does nothing because 'invisible' is on (1)
} elseif ($invisible == "0"){
if ($bold == "1"){
$bold1 = "<b>";
$bold2 = "</b>";
} elseif ($bold == "0"){
$bold1 = "";
$bold2 = "";
}
if ($numberglow == "1"){
$glow1 = "<table STYLE=width:100%;filter:GLOW(color=$glowcolor,strength=#+9)>";
$glow2 = "</table>";
} elseif ($numberglow == "0"){
$glow1 = "";
$glow2 = "";
}
print "<font face='$font' size='$fontsize' color='$textcolor'> $message1 </font><font face='$font' size='$fontsize' color='$numbercolor'>$glow1$bold1$count$bold2$glow2</font><font face='$font' size='$fontsize' color='$textcolor'> $message2</font>";
}
?>
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
More Counters Code Articles
More By Codewalkers
developerWorks - FREE Tools! |
Hold your calendar on January 30, 2008 for this free webcast on the new i5/OS. Rational's Enterprise Modernization products will be discussed at this webcast as they help to drive the application development environment for this new System i OS. <br />And learn how i5/OS will take you to the next step of efficient, resilient business processing. You will hear about the new i5/OS capabilities as it will be the most significant i5/OS release in years. If you cannot join the webcast on 1/30/08 you can still use this link to listen to the replay.<br /> FREE! Go There Now!
|
|
|
|
Join this Rational Talks to You teleconference, featuring Paul Boustany and Mark Krasovich, to speak to the experts about becoming a Rational ClearCase power user. Get a chance to ask your questions and learn tips and tricks for using Rational ClearCase in Agile development FREE! Go There Now!
|
|
|
|
David Barnes, Lead Evangelist for IBM Emerging Internet Technologies will discuss aspects of Web 2.0 that bring value to corporations, academia, and government. He'll also discuss IBM's vision around Web 2.0, including the importance of remixability and consumability. The discussion will culminate with examples of various IBM Software Group solutions you can use to get ahead of the Web 2.0 adoption curve. FREE! Go There Now!
|
|
|
|
Visit IBM developerWorks to download the latest trial version of IBM Data Studio V1.1 at no cost. IBM Data Studio is a comprehensive data management solution that helps you effectively design, develop, deploy and manage your data, databases, and database applications throughout the data management life cycle utilizing a consistent and integrated user interface. Unlike other client-side data management solutions that focus on only one aspect of the application lifecycle or database administration, Data Studio complements the Rational Software Delivery platform, providing unparalleled flexibility for a heterogeneous data server environment across platforms. FREE! Go There Now!
|
|
|
|
Analysts, architects, and developers who have existing COBOL or PL/I skills and want to extend those skills to deploy new workloads on the mainframe can use the IBM Enterprise Modernization Sandbox for System z to find hands-on walkthroughs of common real world scenarios. The scenarios provide examples of how to rapidly design, create, assemble, test, and deploy high-quality Web, Web services, portal, and SOA applications for IBM CICS, IBM IMS, and IBM WebSphere Application Server. FREE! Go There Now!
|
|
|
|
Secure your Web applications with IBM Rational AppScan Standard Edition V7.7, previously known as Watchfire AppScan. This Web application security testing tool automates vulnerability assessments and scans and tests for common Web application vulnerabilities. Visit IBM developerWorks to download a free trial of IBM Rational AppScan Standard Edition V7.7. FREE! Go There Now!
|
|
|
|
XML has become a common way of storing business data as flat files and many data server vendors including IBM have provided ways to store this data within relational database systems. Increasingly collections of XML files are accessed like databases using an xQuery and other XML standard mechanisms. Businesses find the need to combine the traditional tabular structured data with XML formatted data. In this webcast, you’ll learn about IBM’s WebSphere Federation Server technology, which provides users with the ability to integrate these two data formats. FREE! Go There Now!
|
|
|
|
Informix Dynamic Server (IDS) Express Edition offers outstanding online transaction processing (OLTP) database performance, while helping to simplify and automate many of the tasks associated with deploying databases for small business applications. IDS 11 further extends the ease of management and applications integration with the Admin API and Scheduler, high availability with Continuous Log Restore for backup server recovery in case of a primary server failure, and column level encryption to protect personal and company private data. FREE! Go There Now!
|
|
|
|
Get a free trial download of the latest version of IBM Rational Functional Tester V7.0.1. Rational Functional Tester is an automated functional and regression testing solution for QA teams concerned with the quality of their Java, Microsoft Visual Studio .NET, and Web-based applications. FREE! Go There Now!
|
|
|
|
Try the latest version of IBM Rational Manual Tester V7.0.1 by downloading a free trial from IBM developerWorks. This manual test authoring and execution tool promotes test step reuse to reduce the impact of software change on testers and business analysts and addresses the needs of teams performing at least a portion of their testing manually. FREE! Go There Now!
|
|
|
|
All FREE IBM® developerWorks Tools! |