CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Counting hits on a hyperlink to another site (PHP)

Print topic Send  topic

Author Message
Brent
Posted: 01/19/2002, 3:15 PM

This topic is somewhat similar to another one, except instead of going
to a page on my website, it will be going to someone else's. So I don't
have any way of receiving parameters when the user reaches the other page.

So the form may have a link like <A HREF='www.yahoo.com'> Goto yahoo</a>
I'm using PHP and I prefer not to use JSP because the user's browser may
not have Java scripts enabled. Is there a way to trap the click and call a PHP function
prior to going to the new url? I don't want to redirect it back to my page
with the url as a parameter and then intercept the parameter because that would
necessitate redisplaying the page unecessarily and it would be too slow and
confusing to the user.

I'm hoping PHP has some way of sending the url onclick to a function and from
there I could count it and then send the browser to the new url. Is PHP smart
enough to do this? Or do I have to reply on JSP? TIA
Nicole
Posted: 01/21/2002, 1:34 AM

Brent,
the solution will be more complex than one discussed in other thread here. You may use the approach similar to Record form. Create JavaScript function that will check what url was clicked and redirect user to the same page with full url path of clicked url passed as parameter.
Create Open event for the page where check the parameters passed, update table where link hits are stored and redirect user to url passed as parameter. This code will be executed before any output code on the page.
Brent
Posted: 01/21/2002, 7:58 AM

Nicole,
That's what I was trying to avoid.:)

There is a way to do it without using Javascript and without recalling
the current form. I just haven't found it yet.

Brent

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.