WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
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 Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
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
Submit Site
Forex Trading Online forex trading platform

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 : The simple counter with use MySql and gd.
Categories : MySQL, HTTP, Graphics, PHP, Databases Update Picture
Andrey Korlyakov
Date : Feb 20th 1999
Grade : 3 of 5 (graded 2 times)
Viewed : 10710
File : count.php
Images : No Images for this code example.
Search : More code by Andrey Korlyakov
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

It is the simple counter with registration of visitings and
users agent - Internet Explorer(green),Netscape(blue) and Other(Red).
INSTALL:
1. Create the necessary tables. See below.
2. Create in MySql user counter,pass counter with access to these tables.
3. Save code in file count.php3
4. Add string <img src="http://your.host/count.php3"> where you want to put
the counter.

Note 1
array $exception contains ip-addresses from which visiting do not count.
Note 2
If you have one page with different names like
Id URL
4 http://www.some.com/
12 http://www.some.com/index.html
Choose Id from the table counter and change them in the table eq.
WAS: Id Id1
4 4
12 12
make: update eq set Id=4 where Id1=12;
Became:Id Id1
4 4
4 12
==== CREATE TABLE ========
Make this command in mysql
create database count;
use count;
create table agents (
Id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
agent VARCHAR(255) NOT NULL,
type ENUM("IE","Netscape","Other"),
counts INT NOT NULL DEFAULT 0,
last TIMESTAMP,
open TIMESTAMP,
KEY (Id),
INDEX (agent(64)),
UNIQUE (agent)
);
create table counters (
Id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
URL VARCHAR(255) NOT NULL,
counts INT UNSIGNED NOT NULL DEFAULT 0,
IE INT UNSIGNED NOT NULL DEFAULT 0,
Netscape INT UNSIGNED NOT NULL DEFAULT 0,
Other INT UNSIGNED NOT NULL DEFAULT 0,
last TIMESTAMP,
open TIMESTAMP,
KEY (Id),
INDEX (URL(64)),
UNIQUE (URL)
);
create table eq (
id SMALLINT,
id1 SMALLINT
);

========CODE ============
See Attach File




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
Simple pipe delimited file export program that downloads to a local machine
Categories : PHP, Filesystem, Databases, MySQL, HTTP
Identify and log search engine access (spiders, robots, etc.) to a page.
Categories : HTTP, Environment Variables, PHP, MySQL, Databases
This program allows you to upload an ODBC ressource - i.e. an MS-Access database to a MySQL server.
Categories : Databases, MySQL, Complete Programs, PHP, Databases
Loading Images to/from MySQL
Categories : Databases, MySQL, PHP, Graphics
bookmarker - PHP, PHPLIB, MySQL WWW based bookmark manager
Categories : MySQL, PHP, MySQL, Complete Programs, Databases
A simple script to count and report hits and the last modification time of an HTML page. Requires MySQL support (other DBs should work too, except possibly mSQL).
Categories : HTTP, MySQL, PHP, Databases
Accepts a database & hostname from a user and then HTTP username and password. Uses this to connect to a MySQL database. Produces a form based on the tables it finds there to allow the user to do SELECTs, INSERTs, and DELETEs.
Categories : Databases, PHP, MySQL, Complete Programs
Cut your MySQL Connections to 1 line of code
Categories : PHP, Beginner Guides, Databases, MySQL
phpAds, a complete banner and ad management system with detailled tracking and stats.
Categories : MySQL, Complete Programs, Ecommerce, PHP, Databases
Point and Click Interface ala MS Access for creating SQL statements.
Categories : MySQL, Complete Programs, General SQL, PHP, Databases
Displaying records of database in more than one page (paging)
Categories : Databases, MySQL, PHP
html split bar used to split in multiple pages a database result
Categories : HTML and PHP, Databases, MySQL, PHP
Tropicalm Genetree Family (MySQL based family tree)
Categories : PHP, Interfaces, Databases, MySQL, Complete Programs