File "_modif.php"

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

<html>
<title>HOMESITE Patrice DELPY - Modification d'un enregistrement dans 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;
    }

switch ($tab_asso[modifier]){

case 2;
$requete=mysql_db_query( "analogde" ,"update powerball set nom='$nom',prenom='$prenom',main_gauche='$main_gauche',main_droite='$main_droite',endurance='$endurance' where id=$id",$connexion);
echo "<h1 align=center>Mise  jour effectue<br><br><a href='powerball.php'>Retour</a>";
break;

default;

$result=mysql_db_query( "analogde" ,"select * from powerball where id=$id" ,$connexion);
$number = MYSQL_NUM_ROWS($result);

	$nom=mysql_result($result,$i,"nom");
	$prenom=mysql_result($result,$i,"prenom");
	$main_gauche=mysql_result($result,$i,"main_gauche");
	$main_droite=mysql_result($result,$i,"main_droite");
	$endurance=mysql_result($result,$i,"endurance");
	
	
echo "<blockquote><table border=0><form method='get' action='modif.php'><input type='hidden' name=modifier value=2><input type='hidden' name=id value='$id'>
	<td>Nom</td><td><input type='text' name=nom value='$nom' size=10 maxlenght=15></td>
      	<td align=right>Prnom</td><td><input type='text' name=prenom value='$prenom' size=10 maxlenght=15></td><tr>
	
	<td>Gauche</td><td><input type='text' name=main_gauche value='$main_gauche' size=10 maxlenght=15></td>
	<td align=right>Droite</td><td><input type='text' name=main_droite value='$main_droite' size=10 maxlenght=15></td><tr>
	
	<td>Endurance</td><td><input type='text' name=endurance value='$endurance' size=30 maxlenght=5></td>
		
	
      </table></blockquote>";
echo "<table align=center><tr><td><input type='submit' value='Modifier'></td>
       
       <td><input type='reset' value='Tout effacer'></td></form><td>
       <form method=get action='powerball.php'>
       
       
       <input type=submit value='Annuler'></td></form></table>
        <form method=get action='powerball.php'>";
break; }

// referme la connexion
mysql_close();
?>
</body></html>