le 04/02/2007 à 19:25
Duplication de données
Salut LA GLOBULE!!
Je reçois cette information (canada) d'une variable passez en paramètre d'une page à l'autre.
Voici mon code:
<!DOCTYPE html PUBLIC "–//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1–strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title> Historique des enchères ! </title>
<meta http–equiv="Content–Type" content="text/html; charset=iso–8859–1" />
<link rel="stylesheet" media="screen" type="text/css" title="Enchère" href="Art/historic.css" />
</head>
<body>
<?php
if(isset($_POST['histo'])){
$pays_table = $_POST['histo'];
}
else {
$pays_table = " ";
}
$msg = " ";
if ($pays_table != ' '){
$infos = array("proprietaire"=>"Propriétaire :",
"acquisition"=>"Date d'acquisition :",
"identifie"=>"Identifié / Crédit :",
"fin_date"=>"Temps restants :",
"prix"=>"Prix :");
$user = "root";
$host = "localhost";
$database = "membresseuls";
$connection = mysql_connect($host,$user)
or die ("Connexion au serveur impossible");
$db = mysql_select_db($database,$connection)
or die ("Sélection de base de données impossible");
$query = "SELECT * FROM enchere WHERE pays='$pays_table'";
$result = mysql_query($query)
or die ("Exécution de requête impossible");
$ligne = mysql_fetch_array($result);
echo "<p align='center'>
<h1 align='center'>$pays_table</h1>\n";
echo "<br><p align='center'>
<font size='+1'><b>Historiques</b></font><hr>";
echo "<form>
<table width='95%' border='0' cellspacing='0' cellpadding='2'>\n";
foreach($infos as $champ=>$info)
{
echo "<tr>
<td align='right'> <b>{$infos[$champ]} </br></td>
<td><input type='text' name='$champ'
value='$ligne[$champ]' size='65' maxlenght='65'>
</td>
</tr>";
}
echo "<p><input Type='button' Value='Acceuil' onClick=\"location='Artdevelopf.php'\"></p>\n";
echo "<p><input Type='button' Value='Autre pays' onClick=\"location='encheref.php'\"></p>\n";
echo "</form>";
}
else
{
$msg = "Veuillez sélectionner un pays.";
if ($msg != ' '){
echo "<a class='msg'> $msg" ;
echo "<p><input Type='button' Value='Acceuil' onClick=\"location='Artdevelopf.php'\"></p>\n";
echo "<p><input Type='button' Value='Autre pays' onClick=\"location='encheref.php'\"></p>\n";
}
}
?>
</body>
</html>
Je reçois cette information (canada) d'une variable passez en paramètre d'une page à l'autre.
Voici mon code:
<!DOCTYPE html PUBLIC "–//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1–strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title> Historique des enchères ! </title>
<meta http–equiv="Content–Type" content="text/html; charset=iso–8859–1" />
<link rel="stylesheet" media="screen" type="text/css" title="Enchère" href="Art/historic.css" />
</head>
<body>
<?php
if(isset($_POST['histo'])){
$pays_table = $_POST['histo'];
}
else {
$pays_table = " ";
}
$msg = " ";
if ($pays_table != ' '){
$infos = array("proprietaire"=>"Propriétaire :",
"acquisition"=>"Date d'acquisition :",
"identifie"=>"Identifié / Crédit :",
"fin_date"=>"Temps restants :",
"prix"=>"Prix :");
$user = "root";
$host = "localhost";
$database = "membresseuls";
$connection = mysql_connect($host,$user)
or die ("Connexion au serveur impossible");
$db = mysql_select_db($database,$connection)
or die ("Sélection de base de données impossible");
$query = "SELECT * FROM enchere WHERE pays='$pays_table'";
$result = mysql_query($query)
or die ("Exécution de requête impossible");
$ligne = mysql_fetch_array($result);
echo "<p align='center'>
<h1 align='center'>$pays_table</h1>\n";
echo "<br><p align='center'>
<font size='+1'><b>Historiques</b></font><hr>";
echo "<form>
<table width='95%' border='0' cellspacing='0' cellpadding='2'>\n";
foreach($infos as $champ=>$info)
{
echo "<tr>
<td align='right'> <b>{$infos[$champ]} </br></td>
<td><input type='text' name='$champ'
value='$ligne[$champ]' size='65' maxlenght='65'>
</td>
</tr>";
}
echo "<p><input Type='button' Value='Acceuil' onClick=\"location='Artdevelopf.php'\"></p>\n";
echo "<p><input Type='button' Value='Autre pays' onClick=\"location='encheref.php'\"></p>\n";
echo "</form>";
}
else
{
$msg = "Veuillez sélectionner un pays.";
if ($msg != ' '){
echo "<a class='msg'> $msg" ;
echo "<p><input Type='button' Value='Acceuil' onClick=\"location='Artdevelopf.php'\"></p>\n";
echo "<p><input Type='button' Value='Autre pays' onClick=\"location='encheref.php'\"></p>\n";
}
}
?>
</body>
</html>
