Ajax
ASP
C,C++
C#,.NET
CSS,HTML
Delphi,Kylix
Experience
Flash
Java
JavaScript
PHP
Python
QT
SQL
ShellScript
VB
U :
P :
Register
Lost Password
Other Links
Code Archive
Save Giovanni
PHP Category Code
Real Name
:
Secure Shell
Subject
:
Use cookie to create page counter
Description
:
Use cookie to create page counter / Cookie kullanarak sayfa sayacı yapıyoruz.
<?php if (!isset($_COOKIE['visits'])) $_COOKIE['visits'] = 0; $visits = $_COOKIE['visits'] + 1; setcookie('visits',$visits,time()+3600*24*365); ?> <html> <head> <title> Title </title> </head> <body> <?php if ($visits > 1) { echo("This is visit number $visits."); } else { // First visit echo('Welcome to my Website! Click here for a tour!'); } ?> </body> </html>
Rating
:
0.00
(out of 5)
Visitor Voting Booth
:
Excellent
Very Good
Good
Fair
Poor
Copyright © 2006 SharingCode.NET . All rights reserved. Hosted By: SisNetworks