<?php $site=array(); $ok=$_POST['ok']; $site[]=$_POST['site']; if(isset($ok)) { foreach ($site as $choix) { echo $choix; } } else { echo "nothing trouved"; } ?> <html> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> Veuillez choisir un artiste : <select name="site"> <option value=""> ----- Choisir ----- </option> <option value="HTML"> Parick Bruel </option> <option value="PHP"> Julio Eglesias </option> <option value="Javascript"> Usher </option> </select> </form> </html>
<?php $site=array(); $ok=$_POST['ok']; $site[]=$_POST['site']; if(isset($ok)) { foreach ($site as $choix) { echo $choix; } } else { echo "nothing trouved"; } ?> <!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>Untitled Document</title> </head> <?php $link=mysql_connect("localhost","root","")or die("echec serveur"); $db=mysql_select_db("ecole")or die("echec bd"); $requet=mysql_query("select * from student")or die("requet error"); $nb=mysql_num_rows($requet); if($nb==0){ echo "nothing trouved"; } else { ?> <form action=\"<?php echo $_SERVER['PHP_SELF']; ?>\" method=\"post\" name=\"formulaire\">---- , 9, 0, 1, 2, 3, 4, 22, 11, 8, 5, 6, 7, 8, <?php while($tab=mysql_fetch_assoc($requet)){ echo '---- , , , , , , , , , , , , , '.$tab['name'].', '; } } ?> </form> </html>
<?php if(isset($ok)) { $site[]=$_POST['site']; $ok=$_POST['ok']; foreach ($site as $choix) { echo $choix; } } else { echo "nothing trouved";$site=array();$ok=""; } ?> <!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>Untitled Document</title> </head> <?php $link=mysql_connect("localhost","root","")or die("echec serveur"); $db=mysql_select_db("ecole")or die("echec bd"); $requet=mysql_query("select * from student")or die("requet error"); $nb=mysql_num_rows($requet); if($nb==0){ echo "nothing trouved"; } else { ?> <form action=\"<?php echo $_SERVER['PHP_SELF']; ?>\" method=\"post\" name=\"formulaire\"> ---- , 9, 0, 1, 2, 3, 4, 22, 11, 8, 5, 6, 7, 8, <?php while($tab=mysql_fetch_assoc($requet)){ echo '---- , '; foreach($site as $v){ echo ', '; } echo ''.$tab['name'].', '; } } ?> </form> </html>