Page 1 of 1

Modification enables keeping original urls; refreshes count.

Posted: Mon Aug 22, 2005 3:29 pm
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

Posted: Mon Aug 22, 2005 4:29 pm
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

Pup-up blockers

Posted: Tue Aug 23, 2005 3:30 pm
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

You were right

Posted: Tue Aug 23, 2005 3:57 pm
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;}

Posted: Tue Aug 23, 2005 5:27 pm
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