hi,
i need code for count number of times clicked the button. Please help to me.
Thanks.
i need code for count number of times clicked the button
Moderator: General Moderators
The button (if any) would be displayed at the client-side and thus it's impossible to handle that event at the server-side...
Now, if you made sure that the button click would lead to a http post/get requrest... then you could handle that request..
The logic for a counter is pretty simple: new value = old value + 1. So i wonder, what exactly are you having problems with?
Now, if you made sure that the button click would lead to a http post/get requrest... then you could handle that request..
The logic for a counter is pretty simple: new value = old value + 1. So i wonder, what exactly are you having problems with?
Re: i need code for count number of times clicked the button
You may want to do this in Javascript, which executes in the browser, where the button is being clicked. PHP is interpreted by the server BEFORE anything is sent to the browser.qumar wrote:hi,
i need code for count number of times clicked the button. Please help to me.
Thanks.
- Cameri
- Forum Commoner
- Posts: 87
- Joined: Tue Apr 12, 2005 4:12 pm
- Location: Santo Domingo, Dominican Republic
Re: i need code for count number of times clicked the button
Through the use of AJAX techniques, you can handle data back and forth between Javascript and PHP.califdon wrote:You may want to do this in Javascript, which executes in the browser, where the button is being clicked. PHP is interpreted by the server BEFORE anything is sent to the browser.qumar wrote:hi,
i need code for count number of times clicked the button. Please help to me.
Thanks.
If what you are trying to accomplish can be done client-side, that is, it does not need any manipulation from the server, you can just leave it with Javascript, if not, you'll have to fly into the magical world of AJAX.
What is it that you are trying to do?
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
If this is for security in form processing prevention, I would suggest a dual-validation format where you use Javascript on the client and PHP on the server. I'd do it this way because 1) some users disable javascript in their browsers which renders client side validation moot, and 2) it is possible to download your form to their local machine, manipulate it to be what they want and submit it. If it is not checked on the server, you could be hosed.