This example describes a simple voting system implemented by Php+mysql. Share to everyone for your reference, specific as follows:
It's a little long-winded, a little stupid, but it's practical.
<?php
include ' connect.php ';
$name =$_post[' phone '];
$sql = "INSERT into countone values (null, $name, now (), null)";
mysql_query ($sql);
? >
<script type= "Text/javascript" >
alert ("Vote success!") ");
Location= "question.php";
</script>
Link MySQL:
<?php
mysql_connect ("localhost", "root", "");
mysql_select_db ("vote");
mysql_query ("Set names UTF8");
? >
For more information about PHP interested readers can view the site topics: "PHP object-oriented Programming Introduction Tutorial", "PHP string (String) Usage Summary", "Php+mysql Database operation Introduction Tutorial" and "PHP Common database Operation tips Summary"
I hope this article will help you with the PHP program design.