Bouton submit ou input type submit ne marche pas

Résolu/Fermé
zakri-04 Messages postés 23 Date d'inscription dimanche 15 novembre 2020 Statut Membre Dernière intervention 9 août 2023 - Modifié le 30 janv. 2023 à 15:52
zakri-04 Messages postés 23 Date d'inscription dimanche 15 novembre 2020 Statut Membre Dernière intervention 9 août 2023 - 30 janv. 2023 à 22:30

Salutations,

J'ai un code qui contient un formulaire mais le bouton du formulaire <input type"submit"> ne marche pas et j'ai essayé de le changer par le bouton <submit></submit> mais c'est la même chose j'ai cassé ma tête mais plus rien voici le code complet pour bien me comprendre:

<!DOCTYPE html>
<html dir="ltr" lang="en">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta
      name="keywords"
      content="wrappixel, admin dashboard, html css dashboard, web dashboard, bootstrap 5 admin, bootstrap 5, css3 dashboard, bootstrap 5 dashboard, Matrix lite admin bootstrap 5 dashboard, frontend, responsive bootstrap 5 admin template, Matrix admin lite design, Matrix admin lite dashboard bootstrap 5 dashboard template"
    />
    <meta
      name="description"
      content="Matrix Admin Lite Free Version is powerful and clean admin dashboard template, inpired from Bootstrap Framework"
    />
    <meta name="robots" content="noindex,nofollow" />
    <title> ORDONNANCE MEDICALE </title>
    <!-- Favicon icon -->
    <link
      rel="icon"
      type="image/png"
      sizes="16x16"
      href="../assets/images/Stéthoscope.jpg"
    />
    <!-- Bootstrap icons CSS -->
    <link rel="stylesheet" type="text/css" href="../assets/icons-1.10.2/font/bootstrap-icons.css">
    <!-- Custom CSS -->
    <link href="../assets/libs/flot/css/float-chart.css" rel="stylesheet" />
    <!-- Custom CSS -->
    <link href="../dist/css/style.min.css" rel="stylesheet" />
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>
    <!-- ============================================================== -->
    <!-- Preloader - style you can find in spinners.css -->
    <!-- ============================================================== -->
    <div class="preloader">
      <div class="lds-ripple">
        <div class="lds-pos"></div>
        <div class="lds-pos"></div>
      </div>
    </div>
    <!-- ============================================================== -->
    <!-- Main wrapper - style you can find in pages.scss -->
    <!-- ============================================================== -->
    <div
      id="main-wrapper"
      data-layout="vertical"
      data-navbarbg="skin5"
      data-sidebartype="full"
      data-sidebar-position="absolute"
      data-header-position="absolute"
      data-boxed-layout="full"
    >
    <?php
        include('Connexion_BD.php');

        if((isset($_POST['edit_medic'])) AND ($_POST['edit_medic'] == "EDITER")){
            header('Location: medicaments.php');
			die();
        }

        include('menu.php');
        include('sidebar.php');
    ?>
    <!-- ============================================================== -->
      <!-- Page wrapper  -->
      <!-- ============================================================== -->
      <div class="page-wrapper">
        <!-- ============================================================== -->
        <!-- Bread crumb and right sidebar toggle -->
        <!-- ============================================================== -->
        <div class="page-breadcrumb">
          <div class="row">
            <div class="col-12 d-flex no-block align-items-center">
                <h4 class="page-title"> Médicaments </h4>
            </div>
          </div>
        </div>
        <!-- ============================================================== -->
        <!-- End Bread crumb and right sidebar toggle -->
        <!-- ============================================================== -->
        <!-- ============================================================== -->
        <!-- Container fluid  -->
        <!-- ============================================================== -->
        <div class="container-fluid">
            <?php
                if((isset($_GET['oper'])) AND (isset($_GET['id']))){
                    if($_GET['oper'] == "edit"){
                        $id_Medicament = $_GET['id'];
                        $req1 = $bdd -> prepare ('SELECT * FROM medicament WHERE id_Medicament = ?');
                        $req1 -> execute(array($id_Medicament));
                        $donnees1 = $req1->fetch();
                        $nom_Medic = $donnees1['design_Medicament'];
                        $dos_Medic = $donnees1['dosage_Medicament'];
                        $id_typ_Medic = $donnees1['type_Medicament'];
                        $req1->closeCursor();
            ?>
                <from method="post" action="medicaments2.php?oper=edit&id=<?= $id_Medicament; ?>" 
                    class="d-flex flex-column align-items-center justify-content-center position-absolute top-50 start-50 translate-middle border border-3 border-success rounded rounded-3 shadow-lg col-sm-5">
                    <legend class="fs-4 text-dark fw-bold fst-italic text-decoration-underline mt-3 mb-2 text-center"> 
                        Modifier les informations du Médicament : 
                    </legend>
                    <div class="row col-sm-12 m-2">
                        <label class="fs-5 text-dark col-sm-4"> ID Médicament : </label>
                        <div class="col-sm-8">
                            <input type="text" readonly class="form-control fs-5 text-dark" value="<?= $id_Medicament; ?>" name="id_medic">
                        </div>
                    </div>
                    <div class="row col-sm-12 m-2">
                        <label class="fs-5 text-dark col-sm-4"> Nom Médicament : </label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control fs-5 text-dark" value="<?= $nom_Medic; ?>" name="nom_medic">
                        </div>
                    </div>
                    <div class="row col-sm-12 m-2">
                        <label class="fs-5 text-dark col-sm-4"> Dosage Médicament : </label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control fs-5 text-dark" value="<?= $dos_Medic; ?>" name="dos_medic">
                        </div>
                    </div>
                    <div class="row col-sm-12 m-2">
                        <label class="fs-5 text-dark col-sm-4"> Type Médicament : </label>
                        <div class="col-sm-8">
                            <select class="form-select fs-5 text-dark" name="type_medic" aria-label="Default select example">
                                <?php 
                                    $req = $bdd -> prepare('SELECT  * FROM type_medicament');
                                    $req -> execute(array());
                                    while($donnees = $req->fetch()){
                                ?>
                                <option class="fs-5 text-dark" value="<?php echo $donnees['id_Type_Medicament'];?>" <?php if($donnees['id_Type_Medicament'] == $id_typ_Medic){echo "selected";} ?> >
                                    <?= $donnees['type_Medicament']; ?>
                                </option>
                                <?php
                                    }
                                ?>
                            </select>
                        </div>
                    </div>
                    <input type="submit" name="edit_medic" value="EDITER" class="btn btn-lg col-sm-6 btn-success text-white fs-5 mt-3 mb-4 text-center">
                </form>
                <a href="medicaments.php" class="btn btn-sm btn-success fs-6 text-white mb-3">Retour à la liste des Médicaments <i class="bi bi-arrow-return-left"></i></a>
</div>
        <!-- ============================================================== -->
        <!-- End Container fluid  -->
        <!-- ============================================================== -->
    <?php
        include('footer.php');
    ?>

photo :

Prière de me répondre.

Merci.


Windows / Firefox 109.0

2 réponses

jordane45 Messages postés 38145 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 25 avril 2024 4 650
30 janv. 2023 à 17:14

Bonjour,

ça ne marche pas ... c'est à dire ?

Quand tu cliques dessus .. rien ne se passe ?

Ou alors, tu veux peut-être dire que ça ne fonctionne pas comme tu le voudrais au niveau de ta bdd ?

Donc :

1 - Merci de préciser le souci.

2 - Merci d'appliquer les consignes présentes dans ce lien concernant le code PDO : https://forums.commentcamarche.net/forum/affich-37584941-php-pdo-gerer-les-erreurs

3 - Si ton souci concerne la "non réaction" du bouton, merci de poster le code généré de ta page ( CTRL + u lorsque tu affiches ta page dans le navigateur )

3 Bis, Si le souci concerne le fonctionnement du code PHP, merci de nous reposter le code après avoir suivi les instructions du lien que je t'ai donné et de nous donner les éventuels messages d'erreur.


1
zakri-04 Messages postés 23 Date d'inscription dimanche 15 novembre 2020 Statut Membre Dernière intervention 9 août 2023 2
30 janv. 2023 à 22:30

Merci

Le problème était dans la balise <form> que j'ai écrit <from> je m'excuse j'étais très limité dans le temps, manque de concentration.

1