NEW POLL
');
if($_POST['step1']){
?>
');
}elseif($_POST['step2']){
$question = addslashes($_POST['question']);
//delete all previous poll data (no multiple polls yet, maybe later...)
$delete_previous_options = mysql_query(" TRUNCATE `fpoll_options`");
$delete_previous_poll = mysql_query(" TRUNCATE `fpoll_poll`");
$delete_previous_ips = mysql_query(" TRUNCATE `fpoll_ips`");
//insert new poll info
$insert_new_poll = mysql_query("INSERT INTO fpoll_poll (id, question, totalvotes)" . "VALUES ('NULL', '$question', '0')");
$field = $_POST['field'];
//for each option
foreach ($field as $value) {
//add it to the database
$add_fields = mysql_query("INSERT INTO fpoll_options (id, field, votes)" . "VALUES ('NULL', '$value', '0')");
}
echo("Your poll is now ready!
");
}else{
//our first form
?>
}
echo $footer;
?>