hi, my code needs a lot of work, but i want to be able to let users vote on their favorite car, update the database, and display the new updated data for the top ten cars listed. i want to prevent multiple votes by ip but i dont know how, but any help with the voting part of the code GREATLY appreciated, as my google tutorials seem to only show premade code.
here is the page so far.
Code: <?php include("connect1.php");
ini_set('display_errors', 1); error_reporting(E_ALL); // GREAT SNIPPET FOR DEBUGGING OUTPUTS ERRORS TO SCREEN */
//output the cars row into an array and the list the top ten if(isset($_POST['submit'])){ $query="SELECT make, model, year, color, vote FROM cars WHERE votes (is the most number of votes) ; $result=mysql_query($query);
if(mysql_num_rows($result) > 0) { $topcars = mysql_fetch_array($result); //put cars row into an array $topcars
?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Top ten .com </title> </head>
<body> </p> <div align="center">welcome to <strong>vote your cars</strong> </div> <p>Please enter your vote your favorite car.<span class="style4"></span><br /> </p> <form id="form1" name="form1" method="post" action="cars.php">