cs_ScaRT
Messages postés4Date d'inscriptionsamedi 26 avril 2003StatutMembreDernière intervention22 octobre 2003
-
22 oct. 2003 à 18:43
Tomcube
Messages postés311Date d'inscriptionvendredi 4 avril 2003StatutMembreDernière intervention14 septembre 2004
-
22 oct. 2003 à 22:56
Salut à tous,
Voici mon code :
<html>
<head>
<title>% Insertion d'une NotZ %</title>
<style type="text/css">
<!--
input
{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: 12;
color: #FF6600;
background-color: #000000;
BORDER-RIGHT: #FF6600 1px solid;
BORDER-TOP: #FF6600 1px solid;
BORDER-LEFT: #FF3333 6px solid;
BORDER-BOTTOM: #FF6600 1px solid;
}
textarea
{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: 12;
color: #FF6600;
background-color: #000000;
BORDER-RIGHT: #FF6600 1px solid;
BORDER-TOP: #FF6600 1px solid;
BORDER-LEFT: #FF3333 6px solid;
BORDER-BOTTOM: #FF6600 1px solid;
}
select
{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: 12;
color: #FF6600;
background-color: #000000;
BORDER-RIGHT: #FF6600 1px solid;
BORDER-TOP: #FF6600 1px solid;
BORDER-LEFT: #FF6600 1px solid;
BORDER-BOTTOM: #FF6600 1px solid;
}
//-->
</style>
</head>
<?
$add = $_GET['add'];
if($add == add_notz){
$notz_impo = $_POST['notz_impo'];
$titre = $_POST['titre'];
$notz = $_POST['notz'];
$pour = $_POST['pour'];
$host = "localhost";
$user = "root";
$passdb = "";
$base = "notz";
$db = mysql_connect($host,$user,$passdb) or die ("erreur de connexion");
mysql_select_db($base,$db) or die ("erreur de connexion à la base");
$date_verif = date("Y-m-d H:i");
$date = date("d-m-Y");
mysql_query("INSERT Into notz VALUES ('','$date_verif','$date','$notz_impo','$titre','$notz','$pour') ") or die (mysql_error());
mysql_close();
echo"La NotZ '.$titre.' à bien été ajouté à la base de donnée";
header('location: add_notz.php');
}else{
echo"% Insertion du NotZ %";
print'<form method="post" action="add_notz.php?add=add_notz">';
print'% NotZ Importante ! %';
print'% Ajouter Par %
';
print'% Titre de la NotZ %
';
print'% NotZ %
<textarea name="notz" wrap="VIRTUAL" cols="65" rows="15"></textarea>';
print'% A faire pour % : <select name="pour" style="font-family: Verdana;font-size:10px">
<option value="lundi">Lundi
<option value="mardi">Mardi
<option value="mercredi">Mercredi
<option value="jeudi">Jeudi
<option value="vendredi">Vendredi
<option value="samedi">Samedi
<option value="dimanche">Dimanche
</select> ';
print'';
}
?>
</html>
Quand je clique sur le bouton submit, au lieu de m'executer l'action dans le If, rien ne se passe, il vide les champs des input, et va sur la page page.php?add=add_notz
Ca c'est bon, mais il ne m'effectue pas l'action dans le if :sad)
Merci de m'indiquer comment faire, comment résoudre ce problème, et qu'il effectue l'action... ;)