Un bout de code...voila le code de la page supprimer.php
<?php require_once('../Connections/ConnexionScore.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
if ((isset($HTTP_GET_VARS['commerciauxID'])) && ($HTTP_GET_VARS['commerciauxID'] != "")) {
$deleteSQL = sprintf("DELETE FROM commerciaux WHERE ID=%s",
GetSQLValueString($HTTP_GET_VARS['commerciauxID'], "int"));
mysql_select_db($database_ConnexionScore, $ConnexionScore);
$Result1 = mysql_query($deleteSQL, $ConnexionScore) or die(mysql_error());
$deleteGoTo = "confimation.php";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
$deleteGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
header(sprintf("Location: %s", $deleteGoTo));
}
mysql_select_db($database_ConnexionScore, $ConnexionScore);
$query_rsSelectCommerciaux = "SELECT ID, nom FROM commerciaux ORDER BY nom ASC";
$rsSelectCommerciaux = mysql_query($query_rsSelectCommerciaux, $ConnexionScore) or die(mysql_error());
$row_rsSelectCommerciaux = mysql_fetch_assoc($rsSelectCommerciaux);
$totalRows_rsSelectCommerciaux = mysql_num_rows($rsSelectCommerciaux);
?>
<html><!-- InstanceBegin template="/Templates/adminScore.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Document sans titre</title>
<!-- InstanceEndEditable --><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="/images/boutons.css" rel="stylesheet" type="text/css">
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td rowspan="4"><a href="../index.php"><img src="../images/logoqcore.gif" width="92" height="189" border="0"></a></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="boutons"><a href="ajout.php">AJOUT</a></td>
<td class="boutons"><a href="modif.php">MODIF</a></td>
<td class="boutons"><a href="supp.php">SUPP</a></td>
<td class="boutons"><a href="liste.php">LISTE</a></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="4"><div align="center"><font color="#993300" size="6" face="Times New Roman, Times, serif">ESPACE
ADMIN</font></div></td>
</tr>
</table>
<div align="center"><br>
</div>
<!-- InstanceBeginEditable name="EditRegion1" -->
<div align="center">
<form name="form1" method="get" action="supp.php">
<table width="50%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><select name="CommerciauxID" id="CommerciauxID">
<?php
do {
?>
<option value="<?php echo $row_rsSelectCommerciaux['ID']?>"><?php echo $row_rsSelectCommerciaux['nom']?></option>
<?php
} while ($row_rsSelectCommerciaux = mysql_fetch_assoc($rsSelectCommerciaux));
$rows = mysql_num_rows($rsSelectCommerciaux);
if($rows > 0) {
mysql_data_seek($rsSelectCommerciaux, 0);
$row_rsSelectCommerciaux = mysql_fetch_assoc($rsSelectCommerciaux);
}
?>
</select></td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Supprimer"></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form>
</div>
<!-- InstanceEndEditable -->
</body>
<!-- InstanceEnd --></html>
<?php
mysql_free_result($rsSelectCommerciaux);
?>