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
   | <form action="<?php echo $editFormAction; ?>" name="form1" id="form1" method="POST" >
            <table width="55%"  border="0" class="td">
              <tr>
                <td width="34%"><div align="left"></div></td>
                <td width="66%"><div align="left">
                  <label></label>
                </div></td>
              </tr>
              <tr>
                <td><div align="left">Titre:</div></td>
                <td><div align="left">
                  <label></label>
                  <label>
                  <input name="titre" type="text" id="titre" value="<?php echo $row_Rsmodifclient['titre']; ?>" size="32" />
                  </label>
                </div></td>
              </tr>
              <tr>
                <td><div align="left">Description:</div></td>
                <td><label>
                  <div align="left">
                    <textarea name="description" cols="60" rows="3" id="description"><?php echo $row_Rsmodifclient['description']; ?></textarea>
                  </div>
                  </label></td>
              </tr>
              <tr>
                <td><div align="left">prix:</div></td>
                <td><label>
                  <div align="left">
                    <input name="prix" type="text" id="prix" value="<?php echo $row_Rsmodifclient['prix']; ?>" size="20" />
                  €</div>
                  </label></td>
              </tr>
              <tr>
                <td><div align="left">Image:</div></td>
                <td><div align="left">
                  <label>
                  <input name="photo" type="file" id="photo" value="<?php echo $row_Rsmodifclient['photo']; ?>" size="50" />
                  </label>
                </div></td>
              </tr>
              <tr>
                <td><div align="left"></div></td>
                <td><div align="left">
                  <input name="ID" type="hidden" id="ID" value="<?php echo $row_Rsmodifclient['reference']; ?>" />
                </div></td>
              </tr>
              <tr>
                <td> </td>
                <td> </td>
              </tr>
              <tr>
                <td> </td>
                <td><input type="submit" name="Submit" value="Modifier" /></td>
              </tr>
            </table>
 
            <input type="hidden" name="MM_update" value="form1" />
          </form>
 
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
 
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
  $updateSQL = sprintf("UPDATE articles SET titre=%s, `description`=%s, prix=%s, photo=%s WHERE reference=%s",
                       GetSQLValueString($_POST['titre'], "text"),
                       GetSQLValueString($_POST['description'], "text"),
                       GetSQLValueString($_POST['prix'], "double"),
                       GetSQLValueString($_POST['photo'], "text"),
                       GetSQLValueString($_POST['ID'], "int"));
 
  mysql_select_db($database_dream, $dream);
  $Result1 = mysql_query($updateSQL, $dream) or die(mysql_error());
 
  $updateGoTo = "valider.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
    $updateGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $updateGoTo));
}
 
$colname_Rsmodifclient = "-1";
if (isset($_GET['reference'])) {
  $colname_Rsmodifclient = $_GET['reference'];
}
mysql_select_db($database_dream, $dream);
$query_Rsmodifclient = sprintf("SELECT * FROM articles WHERE reference = %s", GetSQLValueString($colname_Rsmodifclient, "int"));
$Rsmodifclient = mysql_query($query_Rsmodifclient, $dream) or die(mysql_error());
$row_Rsmodifclient = mysql_fetch_assoc($Rsmodifclient);
$totalRows_Rsmodifclient = mysql_num_rows($Rsmodifclient); | 
Partager