Forum Moderators: open

Message Too Old, No Replies

image rating, user votes only once

         

dkin

6:19 am on Jul 19, 2005 (gmt 0)

10+ Year Member



I have a small rating form 10 simple radio buttons

how can I have this form submit, refresh with the statistics and not let that user vote on this product again?

<form action="screens.php?op=voted" method="post">1 <input type="radio" name="vote" value="1" onClick="this.form.submit()"/>2 <input type="radio" name="vote" value="2" onClick="this.form.submit()"/>3 <input type="radio" name="vote" value="3" onClick="this.form.submit()"/>4 <input type="radio" name="vote" value="4" onClick="this.form.submit()"/>5 <input type="radio" name="vote" value="5" onClick="this.form.submit()"/>6 <input type="radio" name="vote" value="6" onClick="this.form.submit()"/>7 <input type="radio" name="vote" value="7" onClick="this.form.submit()"/>8 <input type="radio" name="vote" value="8" onClick="this.form.submit()"/>9 <input type="radio" name="vote" value="9" onClick="this.form.submit()"/>10 <input type="radio" name="vote" value="10" onClick="this.form.submit()"/><input type="hidden" name="id" value="'.$id.'" /></form>

kaled

8:52 am on Jul 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do it all server-side.

Call a (perl) script with the form action. This should record the vote and the IP address to avoid repeated voting. It should then deliver the acknowledement page either directly or as a redirect. A redirect would be more sensible.

Kaled.

dkin

9:38 pm on Jul 19, 2005 (gmt 0)

10+ Year Member



I would rather not have it redirect to another page I would like the poll to simply refresh and display results.

Any way to do it this way?

kaled

12:58 am on Jul 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The redirect simply needs to point to the original page. All that remains is to ensure that page caching doesn't stuff things up.

Kaled.