therealwesfoster Posted February 17, 2009 Share Posted February 17, 2009 I'm wanting to create a little JS image what will: Link to a site when clicked on Collect data from the site it is displayed on (hits, unique hits etc) Report the collected stats to a main site which will add them to a DB Any suggestions or tutorials? Wes Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted February 18, 2009 Share Posted February 18, 2009 you dont need js for that. why not simply use an anchor with an image inside <a href="othersite?extradata="><img src="something.jpg" /></a> Quote Link to comment Share on other sites More sharing options...
therealwesfoster Posted February 18, 2009 Author Share Posted February 18, 2009 Thanks for the reply. I'm wanting this little widget to collect data WITHOUT being clicked on. The clicking I mentioned just means that if someone clicks it, go to another site. Wes Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted February 18, 2009 Share Posted February 18, 2009 hmmm then you still dont use javascript. A trick I usually see here is a 1px image thats not even a pixel but a call to an external script for example <img src="getinfo.php?data=info" style="width:1px;height:1px" /> You could just make php write and image and save data to a database. To make it link simply put it in anchor tags <a href="somelink.html"><img src="getinfo.php?data=info" /></a> you still dont need javascript here Quote Link to comment Share on other sites More sharing options...
therealwesfoster Posted February 18, 2009 Author Share Posted February 18, 2009 Ahh, ok. I knew you could do that with php images, but I didn't know it could collect and report data. I'll look more into this Thanks. Solved for now Wes 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.