n8w Posted July 5, 2008 Share Posted July 5, 2008 I currently keep track of external click throughs on my site using a POST form that goes to a php script that looks up the id and then sends the user to the url and counts them as a click if they haven't already been to that link. (based on their ip and user-agent) Is this the best way to approach this? I am sure there is a better way. I am thinking it might be better to use the onclick event so seach engines can follow the links on my site example instead of using a form like this <form action="go.php" method="post" name="frmMyForm8037" target="_blank"> <a href="JavaScript:document.frmMyForm8037.submit();"> <img src="../../images/illustrators/8037.jpg" alt="Matte Stephens" width="190" height="190" border="0" /></a><br /> <input type="hidden" value="8037" name="user_id" /> <input type="hidden" value="ae1c65bbc4e2eb5bcd269273bc80ff4c" name="token" /> </form> use onclick like this <a href="http://www.mattestephens.com" onclick="go.php?user_id=8037&token= ae1c65bbc4e2eb5bcd269273bc80ff4c"> <img src="../../images/illustrators/8037.jpg" alt="Matte Stephens" width="190" height="190" border="0" /></a> How would you approach this with the following things in mind_ seach engines can follow my links clean/simple people can't cheat by clicking a billion times on one link to make it rank higher Quote Link to comment Share on other sites More sharing options...
piyushsharmajec Posted July 5, 2008 Share Posted July 5, 2008 search engine will obviously follow up id by get method. It is quite simple and neat to use & understand. It is easiest way by anyone to cheat from get method so use post and also check id by conditions. Quote Link to comment Share on other sites More sharing options...
Bauer418 Posted July 5, 2008 Share Posted July 5, 2008 The GET method works fine for this approach. The id in the URL is not sensitive data at all. You don't even need an onclick. Simply <a href="/go.php?user_id=8037&token=ae1c65bbc4e2eb5bcd269273bc80ff4c">Text</a> The onclick method would work better for search engines, but then you won't get links counted from anyone that has javascript disabled. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.