So i have the same form 2-3 times in the same page which is a poll question and its generated dynamically from the database so its the same as the others but when i click the submit button i can vote the others aswell since the button on each has the same name with the others…
how can i fix this so it wont affect the other polls?
form is like this:
<form action="" method="post" name="form">
radio buttons here...
<input type="submit" value="Vote" name="btn" />
</form>
You can either have a different name foe each form or a hidden field in each form which tells the question id.
So, after this, in you SQL part just add the
poll_idhere in theWHEREclause. Think this should work