1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
| <html>
<head>
<title>Document sans titre</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="chap" method="post" action="">
<p>
<select name="select" id="c" size="1" >
<option value="1">Chapitre 1 </option>
<option value="2">Chapitre 2 </option>
<option value="3">Chapitre 3 </option>
<option value="4">Chapitre 4 </option>
<option value="5">Chapitre 5 </option>
<option value="6">Chapitre 6 </option>
</select>
</p>
<select name="select2" size="1">
<?php
$host="localhost";
$user="root";
$password="mysql";
$base="projet";
$connect=mysql_connect($host,$user,$password);
if($connect==false)
{die("la connexion a échoué");
}
$connectbase=mysql_select_db($base);
if($connectbase==false)
{echo("basse inaccessible");
}
$a=$_GET['select.c'];
if ($a !=0) then
{echo ("$a");
}
else
{ echo"failed";
}
$res=mysql_query("select * from chapitres,lesson where lesson.nc=$a and chapitres.numc=$a");
if($res==false)
{die("<br> requete incorrect");
}
else
{echo("requete correcte");
}
if($res==false)
{die("requete incorrect");
}
$nb=mysql_num_rows($res);
for($i=0;$i < $nb;$i++)
{$reg=mysql_fetch_array($res);
echo "<option value=\"$a\>""."<br> Leçon".$reg["nl"]." : ".$reg["noml"]."</option>";
}
?>
</select>
</form>
</body>
</html> |
Partager