/    Sign up×
Community /Pin to ProfileBookmark

Link click tracking without database

i would to help with link click counter without database

i have these links
file.exe
file.zip

i wanna to know how many times has been clicked any links for example
file.exe – hits 150
file.zip – hits 320

can someone help me to make this thanks?

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@jouvenetauthorOct 01.2011 — why after I click the link and the content disappears from the site

[code=php]<?php
if(!file_exists('count.txt')){
file_put_contents('count.txt', '0');
}
if($_GET['click'] == 'yes'){
file_put_contents('count.txt', ((int) file_get_contents('count.txt')) + 1);
header('Location: ' . $_SERVER['SCRIPT_NAME']);
die;
}
?>


<?php echo file_get_contents('count.txt'); ?>
<a href="?download=file&click=yes"">download</a>[/code]



[B]?download=file[/B] -> it contains

[B]?download=file&click=yes[/B] -> no content
×

Success!

Help @jouvenet spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...