RE: [PHP] Can you fake a onClick?
| From: | Matt Friedman | Date: | Fri, 28 Dec 2001 03:33:04 +0000 |
| Subject: | RE: [PHP] Can you fake a onClick? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-78902@lists.php.net to get a copy of this message | ||
Please turn off your "read receipt" request in your email client. It's
very annoying.
Create a redirect page using php.
Something like
<?
// log your hits here. Then...
header("Location: $QUERY_STRING");
?>
Using a url such as:
http://www.domain.com/redirect.php?/someurl/somefile.ext
You should be able to track each file requested on your site this way.
Well, that's one way to do it anyway. Perhaps it will give you an
idea...
Matt Friedman
-----Original Message-----
From: Douglas Harter [mailto:douglas.harter@verizon.net]
Sent: Thursday December 27, 2001 8:14 PM
To: Bogdan Stancescu
Cc: PHP Mailing List
Subject: Re: [PHP] Can you fake a onClick?
Maybe I should have mentioned that CountIt is a php function. Does that
make
a difference? It is declared at function CountIt($filename) where
$filename
is the file containing the count.
----- Original Message -----
From: "Bogdan Stancescu" <mgv@fx.ro>
To: "Douglas Harter" <douglas.harter@verizon.net>
Cc: "PHP Mailing List" <php-general@lists.php.net>
Sent: Thursday, December 27, 2001 9:09 PM
Subject: Re: [PHP] Can you fake a onClick?
> Yes: <a href="javascript:CountIt('actual link here')">Text</a>
>
> And in ClickIt you'll have to append
> if (goto) {
> window.location=goto;
> }
>
> Obviously, you'll have to redefine ClickIt() to ClickIt(goto)
>
> I don't know if all the code is 100% accurate, but that's definitely
the
direction to go. You may have to change the JavaScript code to
"parent.window.location=goto" if you use frames.
>
> HTH
>
> Bogdan
>
> Douglas Harter wrote:
>
> > My form contains a function called CountIt which increments a
counter
file on the site. I mainly use it to count the hits on the page. I also
have
multiple <a> links to .zip & .txt files which can be accessed or
downloaded. Is it possible somehow to fake an onclick event so that
when
the user clicks on the link I can use the CountIt function to increment
a
counter for that link?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail:
php-list-admin@lists.php.net
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net