WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Simple PHP/3 Access Counter (using GD and DBM functions)
Categories : Databases, PHP, Graphics, HTML and PHP, dBase Update Picture
Torsten Neuer
Date : Dec 09th 1998
Grade : 2 of 5 (graded 6 times)
Viewed : 13602
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Torsten Neuer
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<?php
//
// PHP/3 WebCounter Module
//
// Copyright (C) 1998 InWise GmbH, Halstenbek, Germany
//
// Please report bugs, enhancements etc to: hostmaster@inwise.de
//
//
// Parameters:
//
// digits=number_of_counter_digits (default: 6)
// font=font_for_counter_digits (default: default)
// key=key_for_counter_digits (default: HTTP_REFERER)
// force=number_for_counter_digits (no default value)
//
// Installation:
//
// - Install the script in an appropriate directory.
// - Install the font files (one GIF encoded image for each digit)
// in subdirectories named after the fonts.
//
// Example:
//
// # mkdir /path/to/digits
// # chown wwwrun.nogroup /path/to/digits
// # mkdir /path/to/digits/default
// # chown wwwrun.nogroup /path/to/digits/default
// # install -c -m 644 -o wwwrun -g group counter.php3 /path/to/digits
// # install -c -m 644 -o wwwrun -g group [0-9].gif /path/to/digits/default
//
// Add to "srm.conf":
//
// Alias /digits/ /path/to/digits/
//
// To enable PHP/3 for .php3 files add to "srm.conf":
//
// AddType application/x-httpd-php3 .php3
//
// Usage:
//
// <IMG SRC="/digits/counter.php3?digits=7" ALT="[counter]">
//

if( !isset($digits) ) {
$digits = 6;
}

if( !isset($font) ) {
$font = "default";
}

if( !isset($key) ) {
if( isset($HTTP_REFERER) ) {
$key = $HTTP_REFERER;
} else {
$key = $PHP_SELF;
}
}

$base = "./";
$dbase = $base."url.gdbm";

if( !file_exists($dbase) ) {
$number = 0;
} else {
$dbm = dbmopen($dbase,"r");
$number = dbmfetch($dbm,$key);
dbmclose($dbm);
}

$dbm = dbmopen($dbase,file_exists($dbase)?"w":"n");
if( isset($force) ) {
dbmreplace($dbm,$key,(string)((int)$force));
} else {
dbmreplace($dbm,$key,(string)(1+(int)$number));
}
dbmclose($dbm);

Header("Content-type: image/gif");
Header("Cache-control: no-cache");
Header("Pragma: no-cache");
Header("Last-modified: ".gmdate("D M d h:i:s Y",time())." GMT");
Header("Expires: ".gmdate("D M d h:i:s Y",time()+1)." GMT");

for( $i=0; $i<10; ++$i ) {
$digit[] = ImageCreateFromGif($base.$font."/".((string)$i).".gif");
}

$dx = ImageSX($digit[0]);
$dy = ImageSY($digit[0]);

$image = ImageCreate($digits*$dx,$dy);

$number = sprintf("%0".((string)$digits)."d",(int)$number);

for( $i=0; $i<$digits; ++$i ) {
ImageCopyResized($image,
                 $digit[(int)substr($number,$i,1)],
                 $i*$dx,0,0,0,$dx,$dy,$dx,$dy);
}

for( $i=0; $i<count($digit); ++$i ) {
ImageDestroy($digit[$i]);
}

ImageGif($image);
ImageDestroy($image);

?>



Functions for loading images into a MySQL database and displaying them.
Categories : Graphics, HTML and PHP, MySQL, PHP, Databases
Creating thumbnails from MySQL Blobs online
Categories : PHP, MySQL, Graphics, HTML and PHP, Databases
Function to do live population of HTML's <Select> tag from a Table
Categories : PHP, MySQL, HTML and PHP, Databases
Automatically printing the contents of an sql table in MySQL.
Categories : MySQL, PHP, HTML and PHP, Databases
Alternating background color for HTML table rows
Categories : PHP, Databases, MySQL, HTML and PHP
Random Image Display
Categories : PHP, Filesystem, Graphics, HTML and PHP
Barcodes On The Fly With GD
Categories : Ecommerce, Graphics, HTML and PHP, PHP
webcam cam view image ispy browser independant
Categories : Graphics, HTML, HTML and PHP, PHP
html split bar used to split in multiple pages a database result
Categories : HTML and PHP, Databases, MySQL, PHP
How can i Preload a 'SELECT MULTIPLE'?
Categories : HTML and PHP, PHP, MySQL, Databases
Record Set Paging with PHP (RSP)
Categories : PHP, MySQL, Navigation, Databases, HTML and PHP
Snipe.Net's Web Design Color Scheme Previewer- Allows uses to input hex codes for their text, background, and link colors, and preview the color scheme with their background image. Example: http://www.snipe.net/tech/snipeschool/hex.php3
Categories : PHP, HTML and PHP, General, Graphics, HTML
This program will take data from a user via a web based form, validate it, show it to the user for re-validation, and finally insert it into the database. Plenty of sanity checking on the fields in the form.
Categories : MySQL, HTML and PHP, PHP, Complete Programs, Databases
A script to generate a report from a valid mysql connection. The user has to supply which fields he wants to display in table. All properties are changable.
Categories : PHP, PHP Classes, Databases, MySQL, HTML and PHP
A very simple way to build and do a hierarchical html categories browser without javascript , just using html php and mySql
Categories : HTML and PHP, Databases, Algorithms, PHP, MySQL