tester une variable pour se rediriger sur une page
bonjour tout le monde.
j'ai un probleme avec mon code au debut il fonctionné normalement puis desque j'ai rajouté un petit teste il ne marche plus !
Voila mon code :
Code:
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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
|
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Sortie Stock</title>
<link href="Style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.Style2 {font-size: large}
.Style5 {font-size: large; color: #0000FF;}
#milieu { height: 500px;
width: 600px;
}
-->
</style>
</head>
<body>
<?php
if(isset($_POST['type']))
{ $pip = $_POST['type'] ;
$query_typ = "SELECT tp FROM type where id_type = '$pip' ";
$rr_typ = mysql_query($query_typ,$connexion) or die("insertion impossible: $query_mat <br>".mysql_error());
$resltnom = mysql_fetch_assoc($rr_typ);
if( $resltnom !== FALSE ) //récupération de la reference du module
{
$sp = $resltnom['tp'] ;
}
}
// if(isset($_POST['hhh']))
//{
//if( $_SESSION['hali'] == 'con')
if( $sp == 'con')
{
$query_cons = "SELECT code_cs,nom_cs, stok_cs FROM consomable where id_type = '$id_tp' order by nom_cs ASC ";
$rr_cons = mysql_query($query_cons,$connexion) or die("insertion impossible: $query_cons <br>".mysql_error());
$resltnom = mysql_fetch_assoc($rr_cons);
if( $resltnom !== FALSE ) //récupération de la reference du module
{
$nm = $resltnom['nom_cs'] ;
$_SESSION['nm'] = $resltnom['nom_cs'] ;
$st = $resltnom['stok_cs'] ;
$_SESSION['st'] = $resltnom['stok_cs'] ;
$cd = $resltnom['code_cs'] ;
$_SESSION['cd'] = $resltnom['code_cs'] ;
}
echo ' </br> ';
echo "Vous allez affecter Le produit consommable <u><i>".$nm." </u></i> qui est present dans votre stock avec la quantité : ".$st." au service ".$sss. " ." ;
echo '</br>';
echo '</br>';
echo ' <div align="left">';
echo ' <form id="form2" name="form2" method="post" action=""> ';
echo '</br>';
echo '</br>';
echo " Quantité Affectée : " ;
echo ' <input name = "qt" type = "text" size = "10" maxlength="60" /> ' ;
echo " <p> </p> ";
echo '<p> <input type="submit" name="dac" value="Valider" /> </p>';
echo ' </form> ';
echo ' </div> ';
if(isset($_POST['dac']))
{
$qt='';
if(isset($_POST['qt'])) { $qt = $_POST['qt'] ; }
if($qt<= $_SESSION['st'] )
{
header('Location: zak.php') ;
exit( ) ;
}
else {
?>
<script language="JavaScript" type="text/javascript">
alert('<?php echo 'Attention vous avez fait entrer une quantité plus élevé que votre stock ! ' ; ?> ');
</script>
<?php }
}
?>
</body>
</html> |
Quand je clique sur Valider il reste sur la même pas mais sans rien affiché je sais pas si je peux trouvé une solution pour ce probleme!
Merci.