Page 1 of 1

Redirecting pdf files

Posted: Tue May 22, 2007 8:50 pm
by pisanggoreng
I have been using ccount for some time now, and really like it. My problem is that I use it to count clicks on pdf files, and these files open in the web browser with the "original" URL in it. Thus, if someone clicks on a link and then want to tell his friends about this document, then he may copy the original URL from the webbrowser and send that to his friend. When his friend clicks this link, the document will open, but the click will not be counted as he is not using the ccount link.

(Did that make sense?)

I would like to redirect the pdf files so that only the ccount URL shows in the web browser. Is that possible?

Thanks in advance.

Posted: Tue May 22, 2007 9:09 pm
by Klemen
The only way I can think of would be with the help of frames. Open click.php in a plain text editor (Notepad) and change line

Code: Select all

Header("Location: $url");
to

Code: Select all

echo '
<html>
<frameset rows="0,100%" border="0">
  <frame frameborder=0 src="blank.htm" />
  <frame frameborder=0 src="'.$url.'" />
  <noframes>
  <p><a href="'.$url.'">Click to continue</a></p>
  </noframes>
</frameset>
</html>
';
If you just want to use this for PDF files and no other you can simply edit one copy of click.php and rename it to for example click_pdf.php and use the normal click.php for other files.

Posted: Thu May 24, 2007 5:00 pm
by pisanggoreng
Thanks a lot! It works perfect! :)