File "effacer.php"

Full Path: /home/analogde/www/videos/powerball/effacer.php
File size: 1.89 KB
MIME-type: text/html
Charset: 8 bit

<html>
<title>HOMESITE Patrice DELPY - Effacer un enregistrement de la base powerball</title>
<body>
<?

    
// connexion avec la base
$db_type   = "mysql";
$db_user   = "analogde";
$db_pass   = "rainbow";
$db_name   = "analogde";
$db_host    = "sql2";


// authentification et connexion
  $connexion = mysql_connect($db_host,$db_user,$db_pass); 
  if(!$connexion)  
    { echo "Dsol, y a un blme, connexion au serveur $db_host impossible\n";
      exit; 
    }

   // pointe sur la base
   $db = mysql_select_db($db_name,$connexion); 
   if(!$db)
      {  echo "Dsol accs a la base $db_name impossible\n";
      }    
    
    
// rcupration des informations
  while (list($var, $value) = each($HTTP_GET_VARS))
    {
      $tab_asso["$var"] = $value;
    }    
    
  

    
    
if ($oui==1) 
{
// supprime l'entre de la table	
$effacer=mysql_db_query("analogde","delete from powerball where id=$id",$connexion);
// affiche le message de confirmation + le lien de retour
echo "<h1 align=center>Enregistrement effac<br><br><a href='powerball.php'>Retour</a>";
}

else {

// EFFACE SI ID=X AU CHARGEMENT
echo "<h1 align=center>Voulez-vous effacer dfinitivement l'enregistrement suivant ? </h1>";
$result = MYSQL_db_QUERY("analogde","select * from powerball where id='$eff'",$connexion);
$number = MYSQL_NUM_ROWS($result);

	$id=mysql_result($result,0,"id");
	$nom=mysql_result($result,0,"nom");
	$prenom=mysql_result($result,0,"prenom");
	$main_gauche=mysql_result($result,0,"main_gauche");
	$main_droite=mysql_result($result,0,"main_droite");
	$endurance=mysql_result($result,0,"endurance");
	
echo	"<p align=center>
	Nom: $nom
	<br>
	Prnom: $prenom
	<br>
	Gauche: $main_gauche
	<br>
	Droite : $main_droite
	<br>
	Endurance : $endurance
	</p>";

echo "<br><br><br><p align=center><a href='effacer.php?id=$id&oui=1'>OUI</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='powerball.php'>NON</a></p>";

}

?>
</body>
</html>