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
|
<html>
<head>
<title>Suppresion du lien</title>
</head>
<body>
Voulez vous vraiment supprimer le lien ?
<br>
<?php
if(isset($_POST['response'])){
$numero_id = $_GET['ID'];
$type_de_reponse = $_POST['response'];
if ($type_de_reponse == "oui"){
mysql_connect('localhost','user','pass');
mysql_select_db('bla');
mysql_query("DELETE FROM news WHERE id ='" . $numero_id . "'") or die(mysql_error());
mysql_close();
echo 'liens supprimer avec succés !';
}
else{
echo 'retour à l\'accueil';
}
}
else{
?>
<center>
<form action="test.php?ID=5" method="post">
<input type="radio" name="response" value="oui">Oui</input>
<input type="radio" name="response" value="non" checked>Non</input>
<input type="submit" value="Envoyer" />
</form>
</center>
<?php
}
?>
</body>
</html> |