Présidentielles 2007 : Comment choisir pour qui voter ? Choisir au hasard un(e) président(e)
$check1 = "checked"; $check2 = "checked"; $check3 = "checked"; $check4 = "checked"; $check5 = "checked"; $check6 = "checked"; $check7 = "checked"; $check8 = "checked"; $check9 = "checked"; $check10 = "checked"; $check11 = "checked"; $check12 = "checked"; $check13 = "checked"; ?> if (!empty ($_POST['go'])) { $options = $_POST['candidat']; $check1 = ""; $check2 = ""; $check3 = ""; $check4 = ""; $check5 = ""; $check6 = ""; $check7 = ""; $check8 = ""; $check9 = ""; $check10 = ""; $check11 = ""; $check12 = ""; $check13 = ""; for ($i=0;$i < sizeof($options) ; $i++) { if ($options[$i] == "Francois Bayrou") {$check1 = "checked";} if ($options[$i] == "Olivier Besancenot") {$check2 = "checked";} if ($options[$i] == "Jose Bove") {$check3 = "checked";} if ($options[$i] == "Marie-Georges Buffet") {$check4 = "checked";} if ($options[$i] == "Philippe De Villiers") {$check5 = "checked";} if ($options[$i] == "Arlette Laguiller") {$check6 = "checked";} if ($options[$i] == "Jean-Marie Le Pen") {$check7 = "checked";} if ($options[$i] == "Frederic Nihous") {$check8 = "checked";} if ($options[$i] == "Segolene Royal") {$check9 = "checked";} if ($options[$i] == "Nicolas Sarkozy") {$check10 = "checked";} if ($options[$i] == "Gerard Schivardi") {$check11 = "checked";} if ($options[$i] == "Dominique Voynet") {$check12 = "checked";} if ($options[$i] == "blanc") {$check13 = "checked";} } if (!empty ($_POST['placarder_x'])) { $placard = $_POST['placard']; if ($placard == "Francois Bayrou") {$check1 = "";} if ($placard == "Olivier Besancenot") {$check2 = "";} if ($placard == "Jose Bove") {$check3 = "";} if ($placard == "Marie-Georges Buffet") {$check4 = "";} if ($placard == "Philippe De Villiers") {$check5 = "";} if ($placard == "Arlette Laguiller") {$check6 = "";} if ($placard == "Jean-Marie Le Pen") {$check7 = "";} if ($placard == "Frederic Nihous") {$check8 = "";} if ($placard == "Segolene Royal") {$check9 = "";} if ($placard == "Nicolas Sarkozy") {$check10 = "";} if ($placard == "Gerard Schivardi") {$check11 = "";} if ($placard == "Dominique Voynet") {$check12 = "";} if ($placard == "blanc") {$check13 = "";} } $tProg["Francois Bayrou"] = "http://www.bayrou.fr/"; $tProg["Olivier Besancenot"] = "http://www.besancenot2007.org/"; $tProg["Jose Bove"] = "http://josebove2007.org/"; $tProg["Marie-Georges Buffet"] = "http://www.mariegeorge2007.org/"; $tProg["Philippe De Villiers"] = "http://www.pourlafrance.fr/"; $tProg["Arlette Laguiller"] = "http://www.arlette-laguiller.org/"; $tProg["Jean-Marie Le Pen"] = "http://www.lepen2007.fr/"; $tProg["Frederic Nihous"] = "http://www.nihous2007.fr/"; $tProg["Segolene Royal"] = "http://www.desirsdavenir.org/"; $tProg["Nicolas Sarkozy"] = "http://www.sarkozy.fr/"; $tProg["Gerard Schivardi"] = "http://www.schivardi2007.com/"; $tProg["Dominique Voynet"] = "http://dominiquevoynet.net"; $tProg["blanc"] = ""; $tName["Francois Bayrou"] = "François Bayrou"; $tName["Olivier Besancenot"] = "Olivier Besancenot"; $tName["Jose Bove"] = "José Bové"; $tName["Marie-Georges Buffet"] = "Marie-Georges Buffet"; $tName["Philippe De Villiers"] = "Philippe De Villiers"; $tName["Arlette Laguiller"] = "Arlette Laguiller"; $tName["Jean-Marie Le Pen"] = "Jean-Marie Le Pen"; $tName["Frederic Nihous"] = "Frédéric Nihous"; $tName["Segolene Royal"] = "Ségolène Royal"; $tName["Nicolas Sarkozy"] = "Nicolas Sarkozy"; $tName["Gerard Schivardi"] = "Gérard Schivardi"; $tName["Dominique Voynet"] = "Dominique Voynet"; $tName["blanc"] = "Vote blanc, vraiment non pas ça. Essayez encore."; foreach ($options as $choix ) { if (!empty ($_POST['placarder_x'])) { if ($choix != $placard) { $tCandidat[] = $choix; } } else { $tCandidat[] = $choix; } } srand((double)microtime()*1000000); $num = rand(0,sizeof($tCandidat)-1); $clef = $tCandidat[$num]; $prog = $tProg[$clef]; $cand = $tName[$clef]; echo "
Le système a choisi de manière aléatoire pour vous :
".utf8_encode($cand)."
Libre et reste à vous de valider que cette option est judicieuse."; if ($prog != "") { echo "
"; echo ""; } else { ?>
Le 18 avril 2007 à 10:08 par Patricia Gallot-Lavallée,
dans Des nouvelles :: des commentaires
:: aucun trackback
