how do you code voting in html?

TheE

New member
I am trying to code my website so that people can vote for individual websites and then I can have the votes make the websites go up in a list in order of most votes.
 
First, either write a php program, or get a free one (like Jack's formmail script), or use a free service (like jotform.com) to arrange for the form output to be sent to your email address! Got that? You'll have to do the tallying on your own, unless you want to go hard-core about it and write a php program that not only processes the form but also stores the results in a database, adding up the results, and periodically sending you the results. Whatever.

< form action="your.php" >
< ... [ other form fields ] ... >
< label >Vote here or forever hold your peace < / label >
< label for= " vote_1" >Website 1< / label >
< input type = "checklist " name = "vote_ 1 " value = "Website 1" />
< label for= " vote_2" >Website 2</ label >
< input type = "checklist " name = "vote_2 " value = "Website 2" />
...
< ... [ and so on, don't forget your submit button ] >
< / form >
 
HTML - Hypertext markup language is used for the GUI (Graphical user interface) of a website,

Simply it handles everything the user sees, what you're trying to do here is get the user to click a radio button and submit.
This is easy in HTML it would just be:

<form id="form1" name="form1" method="post" action="">
<p>Option 1
<label>
<input type="radio" name="radio" id="op1" value="op1" />
</label>
<br />
Option 2
<label>
<input type="radio" name="radio" id="op2" value="op2" />
</label>
<br />
Option 3
<label>
<input type="radio" name="radio" id="op3" value="op3" />
</label>
<br />
Option 4
<label>
<input type="radio" name="radio" id="op4" value="op4" />
</label>
</p>
</form>

HTML WILL NOT store the option chosen, you'd need to look to something more dynamic, and store the choice in a MySQL database, via PHP - its a bit too much to explain on here, [email protected] mail me if you want more info.
 
Back
Top