//Affichage du sondage. $query = doquery ("SELECT * FROM {{table}} ORDER BY id DESC LIMIT 0,1", "sondage"); $vote = mysql_fetch_array($query); if (!empty($vote['question'])) { $question = ' '.stripslashes($vote['question']).'

'; $bouton = '
'; }else { $question = 'Aucun sondage'; $bouton = ''; } $id = $vote['id']; $sondage = ' '.$question.''; if (!isset($_POST["sondage_x"])) { if(!empty($vote['reponse1'])) { $sondage .= ' '.stripslashes($vote['reponse1']).'
'; } if(!empty($vote['reponse2'])) { $sondage .= ' '.stripslashes($vote['reponse2']).'
'; } if(!empty($vote['reponse3'])) { $sondage .= ' '.stripslashes($vote['reponse3']).'
'; } if(!empty($vote['reponse4'])) { $sondage .= ' '.stripslashes($vote['reponse4']).'
'; } $sondage .= '
'.$bouton.''; }else { $save_vote = doquery("UPDATE {{table}} SET resultat1= 'ajouter1', resultat2= 'ajouter2', resultat3= 'ajouter3', resultat4= 'ajouter4' WHERE id='".$vote['id']."'", "sondage"); $insert_ip = doquery("INSERT INTO {{table}} SET numero='".$vote['id']."', ip='".$_SERVER['REMOTE_ADDR']."'", "sondage_ip"); $sondage = 'Vote enregistré ('.$_POST['reponse'].')'; }