Simple Counter
This is a really 2 file way of making a unique hit counter.
If you make a new file called counter.txt and just type the number 1 on the first line.
In a new file, paste the script
|
<?
$file = "counter.txt"; $fp= @fopen($file,"r+"); //this opens the file $myCounter = (int)fgets($fp,10000); // ++$myCounter; // rewind($fp); fwrite($fp,$myCounter); //this will write the value fclose($fp); echo $myCounter; //this shows the value ?> |
And save it as counter.php
Then put in the script where you would like the counter to go!
|
<?
include("counter.php"); ?> |
Make sure these are in the same folder on your FTP, and chmod the file counter.txt to 777.
Redirecting
Simple tutorial that will redirect your user to any page:
Just insert this script where you would like it to show in your .php file:
|
<?php
header("Location: http://new.url/goes/here"); ?> |
Browser Type
Show your browser: just insert this script where you would like it to show in your .php file:
|
<?php
echo $_SERVER['HTTP_USER_AGENT']; ?> |





