IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

PHP & Base de données Discussion :

Probleme Post lors de l'envoi de l'action


Sujet :

PHP & Base de données

  1. #1
    Membre confirmé
    Profil pro
    Inscrit en
    Février 2009
    Messages
    173
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 173
    Par défaut Probleme Post lors de l'envoi de l'action
    Bonjour à tous,

    J'ai un soucis avec ma requete post sur ce code.
    Impossible de changer de page.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
     
    <?php 
    session_start();
    if( isset($_SESSION['panier'])){
    $panier = $_SESSION['panier'];
    $tot=0;// initialisation du total.
    $tottva1=0;// initialisation du total.
    ?>
    <?php
    if(!isset($_SESSION['pseudo']))
    {
    echo "<script language='javascript'>document.location='index.php?page=1'</script>";
    }
    ?>
    <SCRIPT LANGUAGE="Javascript"> 
    function calcul_vente() 
    { 
      window.document.calcul.euro.value=eval(window.document.calcul.prix_achat.value*window.document.calcul.coeff.value); 
     
     if(window.document.calcul.euro.value=="NaN" ) 
      { 
       alert ("Vous n'avez pas saisi un nombre" ); 
      } 
    } 
    function calcul_coeff() 
    { 
      window.document.calcul.coeff.value=eval(window.document.calcul.euro.value/window.document.calcul.prix_achat.value); 
     
     if(window.document.calcul.coeff.value=="NaN" ) 
      { 
       alert ("Vous n'avez pas saisi un nombre" ); 
      } 
    } 
    function calcul_remise() 
    { 
      window.document.calcul.euro.value=eval((window.document.calcul.prix_achat.value*window.document.calcul.coeff.value)*(1-(window.document.calcul.remise.value/100))); 
     
     if(window.document.calcul.euro.value=="NaN" ) 
      { 
       alert ("Vous n'avez pas saisi un nombre" ); 
      } 
    } 
    function start() 
    { 
    window.document.calcul.euro.value=eval(window.document.calcul.prix_achat.value*window.document.calcul.coeff.value); 
     
    } 
     
     
     
    </SCRIPT> 
     
     
    <table border="0" align="center" bgcolor="cccccc" width="95%">
    <tr bgcolor='white'>
    <td width="">Ref: Produit</td>
    <td width="">Produit</td>
    <td width="">Quantité</td>
    <td width="">Px Unité HT</td>
    <td width="">Total HT </td>
    <td width="">&nbsp;</td> 
    </tr>
    <!--// le caddie sera dans un formulaire pour pouvoir réaliser des changements.-->
    <form method="post" action="index.php?page=17&pages=33">
    <?php // connexion à votre base
    connecter();
    foreach ($panier as $valeur=>$cde){//$valeur est l'ID de la fleur et $cde sa quantité dans le panier
    $sql="select * from article where id='$valeur'";
    $req=mysql_query($sql);
    while( $data=mysql_fetch_array($req) ){
    $nom=$data['des'];
    $ref=$data['ref'];//nom de la fleur
    $prix=$data['prix_ht'];// prix unitaire de la fleur
    $pxligne=$prix*$cde; //prix pour la ligne de commande
    $tot+=$pxligne;//valorisation du total général
    $tottva=$tot*1.196;
    $tottva1=$tottva-$tot;
    $total=$tot+$tottva1;
     
    echo"<tr><td>$ref</td><td>$nom</td><td>$cde</td><td>$prix</td><td align='right'>$pxligne €</td><td><input type='checkbox' name='case[]' value='".$data['id']."'></td></tr>";
    }
    }
    ?>
    <tr><td colspan='4' align='right'>Total TVA...</td><td align='right'><?php
    echo number_format($tottva1, 2, ',', ' ')?> €</td></tr>
    <body onLoad="start()"> 
    <form name="calcul"> 
    <input type="hidden" name="prix_achat" value="10"> 
    <input type="hidden" name="coeff" size="10" value="1.2" onKeyUp="calcul_vente()"> 
    <input type="hidden" name="remise" size="10" value="0" onKeyUp="calcul_remise()"> 
    <br><input type="hidden" name="euro" size="10" onKeyUp="calcul_coeff()"> 
    <input type="hidden" name="franc" size="10" disabled>
    </form> 
     
    <body onLoad="start()">
    <form name="calcul">
    <tr><td colspan='4' align='right'>Total ...</td><td align='right'><input type="hidden" name="prix_achat" value="<?php echo number_format($total, 2)?>">  €</td></tr>
    <input type="hidden" name="coeff" size="10" value="1.0" onKeyUp="calcul_vente()">  
    <tr><td colspan='4' align='right'>Remise % ...</td><td align='right'><input type="text" name="remise" size="3" value="0" onKeyUp="calcul_remise()">
    <tr><td colspan='4' align='right'>Total Commandé ...</td><td align='right'><input type="text" name="euro" size="3" onKeyUp="calcul_coeff()"> €</td></tr>
    </form>
    <tr><td colspan='4' align='right'>Nom Client...</td><td align='right'><?php echo $nom_client; ?> </td></tr></table>
    <input type="hidden" name="nom_client" value="<?php echo $nom_client;?>">
    <?php
    mysql_close();}
    ?>
    <tr bgcolor='white'>
    <td colspan="6" align="center"><input type="submit" name="action" value="Supprimer">&nbsp;&nbsp;<input type="submit" name="action" value="Changer">&nbsp;&nbsp;<input type="submit" name="action" value="Encaisser"></td></tr>
    </form>

  2. #2
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Par défaut
    Ton premier formulaire n'a pas de bouton submit.
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

Discussions similaires

  1. [PHP 4] probleme lors de l'envois de mail
    Par Marc31 dans le forum Langage
    Réponses: 2
    Dernier message: 17/11/2011, 08h49
  2. probleme lors de l'envois d'un formulaire
    Par tiffany dans le forum InfoPath
    Réponses: 1
    Dernier message: 09/09/2009, 17h25
  3. probleme lors de l'envoie d'un mail
    Par elfenomeno9 dans le forum Seam
    Réponses: 3
    Dernier message: 06/04/2009, 08h18
  4. Erreur lors de l'envoi de données par post
    Par kohsaka dans le forum jQuery
    Réponses: 1
    Dernier message: 18/01/2009, 21h21
  5. [Mail] Problème lors de l'envoi d'un mail
    Par figo57 dans le forum Langage
    Réponses: 2
    Dernier message: 02/07/2006, 22h55

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo