nielse63
-
Posts
3 -
Joined
-
Last visited
Never
Posts posted by nielse63
-
-
How would I write the PHP script so that it can be recalled? I checked out counter tutorials and examples, and all of the ones that I wrote from there work great for recalling the number of hits, but I'm looking to collect data on the number of clicks and have that automatically posted. Any hints?
Thanks.
-
I'm having some trouble with a click counter that's on my website. Whenever a user clicks on "Good" or "Bad" the number next to it will go up by one, but the problem is that I can't figure out how to store the data for each click so that when the user returns the number remains at what it was (or is higher because other users have clicked on it). As of right now the number is reset to 0 every time the page is reloaded. Here's the code:
<script> function add_to_goodcount1(){ var goodcount1=document.getElementById('goodcount1'); var cstore = document.getElementById('good_counter_score1'); cstore.value=parseInt(cstore.value)+1; goodcount1.innerHTML=cstore.value; } function add_to_badcount1(){ var badcount1=document.getElementById('badcount1'); var cstore = document.getElementById('bad_counter_score1'); cstore.value=parseInt(cstore.value)+1; badcount1.innerHTML=cstore.value; } </script> <a href="javascript:add_to_goodcount1();">Good </a><input type="hidden" name="good_counter_score1" id="good_counter_score1" value='0'><span id="goodcount1">0</span> <p> </p> <a href="javascript:add_to_badcount1();">Bad </a><input type="hidden" name="bad_counter_score1" id="bad_counter_score1" value='0'><span id="badcount1">0</span>
I'm looking to store the data onto a text file on the server, so that the number will be restored. I'm pretty new to AJAX and PHP, so any help would be greatly appreciated.
Thanks!
Problems displaying multiple PHP Polls
in PHP Coding Help
Posted
I have two PHP polls on one page right now using AJAX, and I'm having some trouble with the way that they're being displayed. As of right now, the results for each individual poll are showing up in the same place (the second polls original div tag). I would prefer it if the user to could vote on poll one, have the results displayed in the first div tag, then move on to the second poll and have the results displayed in the second div tag. Here's the code:
HTML Code (for the initial display page)
The JS Source Code:
And finally, the PHP Code. There are two separate pages, as you can see from JS, but I'm only displaying one for the sake of space:
This is really just a sample of what I'm trying to do, I guess, but the way that each are displaying is really becoming a headache. Any help would be appreciated. Thanks!