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
|
<html>
<head>
<link href="css/form.css" rel="stylesheet" type="text/css">
</head>
<body>
<?php
//connexion a la base
include_once("connexion/connexion.php");
if (isset($HTTP_POST_VARS["Selectionner"]))
{
echo "<form method='POST' name='modif' ACTION='formModif.php'>";
echo "<div id=\"titreForm\">Selection d'une valeur</div>";
echo "<div id=\"corpForm\">";
echo "<fieldset>";
echo "<legend><h3>table : ".$_POST['table']."</legend></h3>";
$table=$_POST['table'];
$req="select * from ".$table.";";
$result=mysql_query($req);
echo "<p><label>Selectionnez l'attribut : </label>";
echo "<select name=id>";
while ($ligne=mysql_fetch_array($result))
{
echo "<option value='".$ligne[0]."'>".$ligne[0]."</option>";
}
echo "</select>";
echo "</p></fieldset></div>";
echo "<div id=\"piedForm\">";
echo "<input type=hidden name='table' value='".$table."'>";
echo "<INPUT TYPE='submit' NAME='modifier' VALUE='Modifier'>";
echo "</div></form>";
}
else
{
echo "<form method='POST' name='selectdonnees' ACTION='index2.php'>";
echo "<div id=\"titreForm\">Selection d'un table</div>";
echo "<div id=\"corpForm\">";
echo "<fieldset>";
echo "<legend><h3>base : ".$database."</legend></h3>";
$req="show tables";
$result=mysql_query($req);
echo "<p><label>Selectionnez la table : </label>";
echo "<select name=table>";
while ($ligne=mysql_fetch_array($result))
{
echo "<option value='".$ligne[0]."'>".$ligne[0]."</option>";
}
echo "</select>";
echo "</p></fieldset></div>";
echo "<div id=\"piedForm\">";
echo "<INPUT TYPE='submit' NAME='Selectionner' VALUE='Selectionner'>";
echo "</div></form>";
}
?>
</body>
</html> |
Partager