Edit Template

html

<?php

session_start();

$connexion= new PDO(‘mysql:host=localhost;dbname=users_base1′,’root’, »);

if($connexion)

{

    echo « conecter »;

}

if (isset($_POST[« valider »]))

 {

    echo « valider »;

    if(!empty($_POST[’email’])AND !empty($_POST[‘password’]))

    {

        $email = htmlspecialchars($_POST[’email’]);

        $password = sha1($_POST[‘password’]);

        $reqt=$connexion->prepare(« SELECT * FROM users WHERE  email = ? AND password=? »);

        $reqt->execute(array($email,$password));

        $controlmdp=$reqt->rowCount();

        if($controlmdp==1)

        {

            $message= »Ereer: votrea compt a bien ete trove. »;

            $info=$reqt->fetch(PDO::FETCH_ASSOC);

            $_SESSION[‘id’]=$info[‘id’];

            $_SESSION[‘nom’]=$info[‘nom’];

            $_SESSION[‘prenom’]=$info[‘prenom’];

            $_SESSION[’email’]=$info[’email’];

            header((« Location:profil.php?id= »).$_SESSION[‘id’]);

             }    

    }else{

        $message= »Ereer: Désile mous me trouvons pas ce compte. »;

    }

 }

?>

<!DOCTYPE html>

<html lang= »en »>

<head>

    <meta charset= »UTF-8″>

    <meta name= »viewport » content= »width=device-width, initial-scale=1.0″>

    <title>Connexion</title>

    <link rel= »stylesheet » href= »css/bootstrap.min.css »>

    <link rel= »stylesheet » href= »css/all.min.css »>

</head>

<body class= »bg-light col-md-6 mx-auto p-4″>

<form action= » » method= »post »>

        <h3>Contact</h3>

        <label>Email</label><br>

        <input type= »email » name= »email » class= »form-control » placeholder= »E-mail »><br>

        <label>Email</label><br>

        <input type= »password » name= »password » class= »form-control » placeholder= »Mot de passe »><br>

        <button type= »submit » name= »valider » class= »btn btn-success »> S’inscrire </button><br>

        <i style= »color:red »>

                              <?php

                                if(isset($message)){

                                    echo $message. »<br> »;

                                }

                                ?></i>

    </form>

</body>

</html>

<script src= »bootstrap.bundle.js »></script>

Leave a Reply

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Company

Our ebook website brings you the convenience of instant access to a diverse range of titles, spanning genres from fiction and non-fiction to self-help, business.

Features

Most Recent Posts

  • All Post
  • Children's Books
  • Education/Reference
  • Mystery/Thriller
  • Non classé
  • Religion/Spirituality
  • Science/Technology

eBook App for FREE

Lorem Ipsum is simply dumy text of the printing typesetting industry lorem.

Category

learning arab

© 2025 learning arab

wpChatIcon
    wpChatIcon