Computer ForumsComputers  

Go Back   Computer Forums > Programmers Lounge > Programming Discussions

Reply
 
LinkBack Thread Tools Display Modes
Old 06-25-2007, 04:26 PM   #1 (permalink)
Ultra Techie
 
Join Date: Dec 2004
Posts: 531
Default Can someone write this script for me? Count clicks

I want to have a button that is an "Make this your homepage" type thing, and I'd like a counter that displays how many times that was clicked.

If there is anyway to do this, I'm no good at programming and I'd appreciate a small script that would show this. I am aware that button to make homepage would probably only work in IE, but it's the clicks that matter.
__________________
Quintox is offline   Reply With Quote
Old 06-25-2007, 04:42 PM   #2 (permalink)
Monster Techie
 
Join Date: May 2004
Location: Tucson, AZ, USA
Posts: 1,184
Send a message via AIM to Vormund Send a message via MSN to Vormund Send a message via Yahoo to Vormund
Default Re: Can someone write this script for me? Count clicks

There are two possible ways of doing this that come to mind:
1) You can use javascript to set a cookie when the user clicks the link/button, and then if the user navigates elsewhere on your website, the cookie could be read by a server side script and logged in a file or database.
2) Using ajax, you could send the update right away by doing a get/post to a page.

One thing to think of though, if you want all clicks counted, just once per IP, or both (all clicks is easy/relating to the IP just means a little more processing as you have to loop through the old data). Both would be relatively easy, at least, if your server supports PHP?
__________________
Vormund is offline   Reply With Quote
Old 06-28-2007, 04:35 AM   #3 (permalink)
Newb Techie
 
Join Date: Jun 2007
Posts: 19
Default Re: Can someone write this script for me? Count clicks

Quote:
<FORM>
<INPUT TYPE="button"
VALUE="Make This Page Your Home Page"
onClick="this.style.behavior='url(#default#homepag e)';
this.setHomePage('http://www.google.com');">
</FORM>
Button to make your home page & there are a few PHP scripts to count clicks of links.Just google it.
lutics is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need a good captcha generating php script surut Windows Operating Systems and Software 1 05-26-2007 09:23 AM
Why does a USB extension cable causes occasional flash drive write error? piggysmile Hardware Troubleshooting 3 05-07-2007 01:29 PM
Another BASH Script Greg Linux, BSD, other *nixes & Open Source Software 2 04-17-2007 06:35 PM


All times are GMT -5. The time now is 07:54 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0