Home
40) { error('Your link name is too long! Please limit your name to maximum 40 chars!'); } $new_count = input($_POST['count']); if (preg_match("/D/",$new_count)) { $new_count = 0; } $found=0; $i=0; $lines = file($settings['logfile']); foreach ($lines as $thisline) { if (strpos($thisline, $id.'%%') === 0) { $thisline = trim($thisline); list($id,$added,$url,$count,$name) = explode('%%',$thisline); $lines[$i]=$id.'%%'.$added.'%%'.$new_url.'%%'.$new_count.'%%'.$new_name."rn"; $found=1; break; } $i++; } if ($found != 1) {error('This ID doesn't exist!');} $content = implode('', $lines); $fp = @fopen($settings['logfile'],'w') or error('Can't write to log file! Please Change the file permissions (CHMOD to 666 on UNIX machines!)'); flock($fp, LOCK_EX); fputs($fp,$content); flock($fp, LOCK_UN); fclose($fp); mainpage('Changes to link ID '.$id.' have been saved!'); } // END savelink function editlink() { global $settings; $id=checkid(); $found=0; $i=0; $lines = file($settings['logfile']); foreach ($lines as $thisline) { if (strpos($thisline, $id.'%%') === 0) { $thisline = trim($thisline); list($id,$added,$url,$count,$name) = explode('%%',$thisline); $found=1; break; } $i++; } if ($found != 1) {error('This ID doesn't exist!');} printHeader(); ?>
'.$settings['logfile'].'!'); } if (!move_uploaded_file($_FILES['backup']['tmp_name'], $settings['logfile'])) { error('There has been an error uploading the backup file! Please make sure your log file ('.$settings['logfile'].') is writable by PHP scripts. On UNIX machines CHMOD it to 666 (rw-rw-rw-)!'); } printHeader(); ?>
Backup restored: |
40) { error('Your link name is too long! Please limit your name to maximum 40 chars!'); } $start_from = input($_POST['count']); if (preg_match("/D/",$start_from)) { $start_from = 0; } $previd = file_get_contents($settings['idfile']); $previd = trim($previd); $previd++; $fp = @fopen($settings['idfile'],'w') or error('Can't write to the IDs file ('.$settings['idfile'].')! Make sure PHP scripts have permission to write to this file (CHMOD it to 666 on LINUX machines!)'); flock($fp, LOCK_EX); fputs($fp,$previd); flock($fp, LOCK_UN); fclose($fp); $addline = $previd . '%%' . date('Y/m/d') . '%%' . $url . '%%'. $start_from . '%%' . $name . "rn"; $fp = @fopen($settings['logfile'],'a') or error('Can't write to the log file ('.$settings['logfile'].')! Make sure PHP scripts have permission to write to this file (CHMOD it to 666 on LINUX machines!)'); flock($fp, LOCK_EX); fputs($fp,$addline); flock($fp, LOCK_UN); fclose($fp); printHeader(); ?>
Link added |
New link successfully added! A new link with ID has been successfully added. To count clicks on this link use this URL:
|
0 clicks!'); } // END resetlink function removelink() { global $settings; $id=checkid(); $found=0; $i=0; $lines = file($settings['logfile']); foreach ($lines as $thisline) { if (strpos($thisline, $id.'%%') === 0) { unset($lines[$i]); $found=1; break; } $i++; } if ($found != 1) {error('This ID doesn't exist!');} $content = implode('', $lines); $fp = @fopen($settings['logfile'],'w') or error('Can't write to log file! Please Change the file permissions (CHMOD to 666 on UNIX machines!)'); flock($fp, LOCK_EX); fputs($fp,$content); flock($fp, LOCK_UN); fclose($fp); if ($found != 1) { error('This ID doesn't exist!'); } mainpage('Link with ID '.$id.' was successfully removed!'); } // END removelink function mainpage($notice='') { global $settings; printHeader(); ?>
'; } ?>
Link statistics
Not counting any links. Use the form below to add new links to be counted.'; } else { $i=0; foreach ($lines as $thisline) { $thisline = trim($thisline); list($id,$added,$url,$count,$linkname)=explode('%%',$thisline); $totalclicks += $count; if($count > $maxclicks) { $maxclicks = $count; $maxid=$id; } $i++; } $average = $totalclicks/$i; $average = number_format($average, 1); echo ' '; if ($maxclicks != 0) { echo ' '; } echo '
Total links: | '.$i.' |
Total clicks: | '.$totalclicks.' |
Average clicks: | '.$average.' |
Maximum clicks: | '.$maxclicks.' (link ID '.$maxid.') |
ID | Clicks | Added | Web page | Graph | |
'.$id.' | '.$count.' | '.$added.' | '.$linkname.' |
TIP: For best performance you should remove links you don't use anymore. Button functions are explained below:
- delete link
- reset number of clicks to 0
- edit link
Use this form to add a new link to track clicks on. Required fields are marked bold.
Start counting from:1 | |
Link name:2 | |
Link URL:3 | |
1 | CCount will start counting clicks from the number you choose (default: start counting from 0). |
2 | Link name is a unique name for this link (max 40 chars including spaces). This name will be displayed as "Web page" in the statistics. If you don't choose a name the link URL will be displayed. |
3 | URL of the link you want to count clicks on. |
Download backup
You may download a backup of the link database and restore it in the future should your link file be corrupted for any reason.
Click to download backup
Restore backup
Usage
To track clicks on a link, use this URL instead of the link original URL:
?id=ID
Replace ID with the ID number of the URL, for example:
?id=13
Rate this script
If you like this script please rate it or even write a review at:
Rate this Script @ Hot Scripts
Rate this Script @ The PHP Resource Index
Stay updated
Join my FREE newsletter and you will be notified about new scripts, new versions of the existing scripts and other important news from PHPJunkYard.
Click here for more info
LOGGED OUT |
You have been successfully logged out.
|
Enter admin panel |
ERROR |
An error occured:
|
Bienvenido a iCodes-Mundo.es.tl
Revisa nuestro almacenamiento de codigos para tu web.
Html
Css
Javascript
PWG Codigos
Chat
PHP Click Counter -- Admin panel -- |