show the votes on my website?
Posted: Mon Oct 25, 2004 1:55 am
Hi!
i just created a poll(voting script).
and i want the script to show how many that have voted:
example:
Votes
Nice page: 20 votes
Ugly page: 15 votes
The poll is connected to the database and work perfectly , when you vote it saves in the database. but i dont know how to do so it shows in the website how many votes there is. and i want them to only vote once! not many times. i guess i must use Cookies for that. i could need some help with that to.
Well, here is the code:
If you need the html code to, just tell me =).
Thanks, Masomehs
i just created a poll(voting script).
and i want the script to show how many that have voted:
example:
Votes
Nice page: 20 votes
Ugly page: 15 votes
The poll is connected to the database and work perfectly , when you vote it saves in the database. but i dont know how to do so it shows in the website how many votes there is. and i want them to only vote once! not many times. i guess i must use Cookies for that. i could need some help with that to.
Well, here is the code:
Code: Select all
<?
if(isset($_POSTї'vote'])) {
echo "Du röstade på alternativ nummer ".$_POSTї'vote'];
}
$sql = "UPDATE vote SET roster=roster+1 WHERE alternativ=$_POSTїvote]";
include_once 'connect.php';
mysql_query($sql);
?>Thanks, Masomehs