Modification enables keeping original urls; refreshes count.

Everything related to CCount PHP click counter
Post Reply

do you find this modification useful?

no
1
50%
yes
0
No votes
yes if modified further
1
50%
 
Total votes: 2

inverudio
Posts: 3
Joined: Mon Aug 22, 2005 2:57 pm

Modification enables keeping original urls; refreshes count.

Post by inverudio »

Script URL: http://inverudio.com/php/ccount_test.php
Version of script: 1.0
Version of PHP: 4.3.11
Hosting company: bluehost.com
Have you searched THIS FORUM for your problem: yes
(if not please do before posting)
If so, what terms did you try: I read existing two topics

/*************************************
Title: Keep original urls and refresh the count
Version: 1.0
Author: Lazar Kovacevic
Demo: http://inverudio.com/php/ccount_test.php
Download: Copy paste the code few lines below!
Website: http://www.inverudio.com

Description: This modification has 2 advantages:
1. Webmaster doesn't lose information in webpages about what files are being downloaded.
2. Page is refreshed, and new count is displayed.

*************************************/

---------------------------------------------------------------------
click.php MODIFIED PART
---------------------------------------------------------------------

Code: Select all

// Redirect to the link URL

//------------------------------------------------
#MODIFICATION BY ME
$ref=@$HTTP_REFERER;
//Header("Location: $url");
header("Location: " . $ref);
#END OF MODIFICATION
//------------------------------------------------
Code in webpage where count is displayed is also changed, and can be seen at http://inverudio.com/php/ccount_test.php when you view the page source. You can also see there how the counter works.

Lazar
Klemen
Site Admin
Posts: 10114
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Hi,

Just wanted to say that pop-up blockers block your modified link code and nothing is being downloaded. In my opinion it brings more problems, but I am sure some might find it useful.

Thanks for sharing!

Regards
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
inverudio
Posts: 3
Joined: Mon Aug 22, 2005 2:57 pm

Pup-up blockers

Post by inverudio »

I have both Mozilla Firefox, and Internet Explorer.

Modified ccount works fine with Mozilla with and without pop-up blocking, while in IE it forwards me to administrative panel both with and without pop-up blocking !?!

I think that some other issue may be involved.

Lazar
inverudio
Posts: 3
Joined: Mon Aug 22, 2005 2:57 pm

You were right

Post by inverudio »

pop-up blocker does block in IE, I checked on another computer, but also in IE, even without pop-up blocker it forwards main page to admin panel. I guess that HTTP_REFERER is not smart enough to recognize if www is missing. I don't have this problem in Mozilla.

Lazar

ps. I'm not gonna use this modification as it is either. I was not aware of this pop-up issue because for some reason it is not present on my computer.


Though I had simmilar problem before. I'm posting it here, maybe someone will know the answer.
---------------
It works only from my computer! From other computers it always executes {exit} even if I go from http://www.inverudio.com/index.php page. Very strange! If someone has an idea about the solution, please send me a feedback.
Code that makes the problem goes like this:
$ref=@$HTTP_REFERER; if ($ref=="http://www.inverudio.com/"||$ref=="http ... rudio.com/") {} else{exit;}
Klemen
Site Admin
Posts: 10114
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Hi,

Also keep in mind some browsers either don't send the HTTP_REFERER or it can be disabled.

In my opinion replacing the original URL with click.php?id=XX is the easiest and most reliable way to go.


If you worry about SEO you might try using Javascript and use direct links in noscript tags, like this (haven't tested for syntax but should give you the idea):

Code: Select all

<script language="Javascript"><!--
document.write('<a href="http://www.redirect.com/click.php?id=ID">Click here</a>');
-->
</script>
<noscript>
<a href="http://www.CLEANURL.com">Click here</a>
</noscript>
Since (most?) SE robots don't read Javascript they will see the direct link and spider it.

Regards
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply