voting form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kujtim
Forum Commoner
Posts: 35
Joined: Sat Oct 25, 2003 4:00 am
Location: kosovo
Contact:

voting form

Post by kujtim »

<?php
if ( $submit )
{
if ( $vote )
{
echo "You rated me a: $vote <br>Thank you very much!<br><br>";
}
}
?>

<html>
<head>
<title> Vote form </title>
</head>
<body>
Rate my script [ 1 (sucks) - 5 (best) ] <br>
<blockquote>
<form name="vote" method="post" action="vote.php">
<input type="radio" name="vote" value="1"> - 1 <br>
<input type="radio" name="vote" value="2"> - 2 <br>
<input type="radio" name="vote" value="3"> - 3 <br>
<input type="radio" name="vote" value="4"> - 4 <br>
<input type="radio" name="vote" value="5"> - 5 <br>
<br>
<input type="submit" name="submit" value="Rate Me!">
</form>
</blockquote>
</body>
</html>

how to have an statistic about this voting form how to now how many people have voted me with excelent
i belive thet i must work with database mysql
but how to ...
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

You may not need a mysql (or any other) database for this, you could just log the rating to a file:
http://php.net/manual/en/ref.filesystem.php

Plus you should also learn about register_globals and how to future proof your code:
Concerning Passing Variables in PHP 4.2+

Mac
Post Reply