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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN"
"http://www.w3.org/TR/xhtmll/DTD/xhtmll-transitional.dtd">
<html Xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>DVD</title>
<link href="formulaire.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div align="center">
<a href="http://www.google.com"><IMG SRC="images/dvd.jpg" ALT="dvd" TITLE="dvd" BORDER="no" width="500px" height="250px" ></a>
</div>
<p><p/>
<p><p/>
<p><p/>
<fieldset id="field">
<br />
<?php
define('DB_SERVER', 'localhost');
define('DB_SERVER_USERNAME', 'root');
define('DB_SERVER_PASSWORD', '');
define('DB_DATABASE', 'mediapourvous');
$connect = mysql_connect(DB_SERVER, DB_SERVER_USERNAME,
DB_SERVER_PASSWORD)
or die('Impossible de se connecter : ' . mysql_error());
mysql_select_db(DB_DATABASE, $connect);
$rq = "SELECT id, dvd FROM support";
$result = mysql_query($rq) or die ("Exécution de la requête impossible");
echo "<form action='dvd.php' method='post'><select name='dvd'>";
while ($liste=mysql_fetch_array($result))
{
extract($liste);
if(isset($_POST['dvd']) && $dvd == $_POST['dvd'])
echo "<option value='$dvd' selected>$dvd\n";
else
echo "<option value='$dvd'>$dvd\n";
}
echo "</select>\n";
echo "<input type='submit'"."value='Go'></form>\n";
if(isset($_POST['dvd']))
{
$sql = "SELECT * FROM support WHERE dvd='".$_POST['dvd']."'" ;
$req = mysql_query($sql) or die( mysql_error() ) ;
$total = mysql_num_rows($req);
{
echo '<form method ="post" action="dvd.php">';
echo '<table>'."\n";
echo '<tr>';
echo '<th ><b>dvd</b></th>';
echo '<th ><b>cd</b></th>';
echo '<th><b>cassette</b></th>';
echo '</tr>'."\n";
while($row = mysql_fetch_array($req))
{
echo '<tr>';
echo '<td>'.$_POST['dvd'].'</td>';
echo '<td><textarea row="3" name="dvd" value=votre texte />
Réf:
titre:
</textarea></td>';
echo '<td><textarea row="4" name="cd" value=votre texte />
Réf:
titre:
</textarea></td>';
echo '<td><textarea row="3" name="casette" value=votre texte />
Réf:
titre:
</textarea></td>';
echo '</tr>'."\n";
}
echo '</table>'."\n";
echo '<input type="hidden" name="dvd2" value="'.$_POST['dvd'].'" /><br><input type="submit" name="ok" value="Modifier"/>';
echo '</form>';
}
}
if (isset($_POST['ok']))
{
echo $sql2= "UPDATE support SET dvd='".$_POST['dvd']."', cd='".$_POST['cd']."', cassette='".$_POST['cassette']."',
WHERE dvd='".$_POST['dvd2']."'";
$req2= mysql_query($sql2) or die('Erreur SQL !'.$sql2.'<br>'.mysql_error());
}
if(isset($req2))
{
echo '<form method="POST" action="support2.php" enctype="multipart/form-data">';
echo '<table>'."\n";
echo '<tr>';
echo '<td><input type="hidden" name="MAX_FILE_SIZE" value="10000000"></td>';
echo '<td>Joindre la pochette de votre support : <input type="file" name="fichier">/n</td>';
echo '<td><input type="text" name="album" value="'.$row["album"].'"/></td>';
echo '</tr>'."\n";
echo '</table>'."\n";
echo '<input type="submit" name="Ok" value="Modifier"/></center>';
echo '</form>';
}
?>
</fieldset>
</div>
</body>
</html> |
Partager