I have several webpages that have an inserted javascript in the header in this form -
<script language="JScript.Encode" src="http://www.mydomain.com/myjavascript.js"></script>
What I want to do is to only insert the javascript when the page has been visited 10 times, not by the same person, but a total number of 10 visits to the page must be made before the javascript is used.
It would have to be something like this -
<script language="JScript.Encode" src="http://www.mydomain.com/myjavascript.php"></script>
That php script when called will
- note the url of the referring webpage
- count the number of hits
- if the hits is more than 10 will return the myjavascript.jss file
- if less than 10 return something else.
How do I go about doing this? Is this possible? I've done a bit of php coding some time back, but this one seems a bit complex. A little start off help would be nice!
Thanks,
Neole