PHP PDO Tutorials PHP Registration and Login form Using database PART 1 2017




source code is here — http://justclack.blogspot.com/2016/11/php-pdo-tutorials-php-registration-and.html PHP PDO Tutorials PHP Registration and Login form …

Original source


22 responses to “PHP PDO Tutorials PHP Registration and Login form Using database PART 1 2017”

  1. This is brilliant but unfortunately I get an error on my insert statement
    $insert = $con->prepare ("INSERT INTO users_details (forename,
    surname, address_line1, address_line2, address_line3, city,
    postcode, phone, email) VALUES(:forename, :surname, :address_line1,
    :address_line2, :address_line3, :city, :postcode, :phone, :email) ");
    "INSERT INTO users (username, password)
    VALUES(:username,:password)";
    I cannot figure out where I am going wrong.

  2. <?php
    try{

    $con = new PDO ("mysql:host=localhost;dbname=database_connection","root","");

    if(isset($_post['submit']))
    {
    $Name = $_post['Name'];
    $age = $_post['age'];
    $city = $_post['city'];
    $Address = $_post['Address'];
    $registration_date = $_post['registration_date'];
    $Gender = $_post['Gender'];

    $insert=$con->prepare("INSET INTO database_connection (name,age,city,Address,registration_date,Gender)
    values(:name,:age,:city,:Address,:registration_date,:Gender) ");
    $insert->bindParam(':Name',$Name);
    $insert->bindParam(':age',$age);
    $insert->bindParam(':city',$city);
    $insert->bindParam(':Address',$Address);
    $insert->bindParam(':registration_date',$registration_date);
    $insert->bindParam(':Gender',$Gender);

    $insert->execute();

    }

    }
    catch(PDOException $e)
    {
    echo "Error".$e->getMessage();
    }

    ?>

    <!DOCTYPE html>
    <html>
    <head>
    <form method="post">

    <br><br>
    <title>Patient </title>
    <style type="text/css">
    body{
    background-image: url(vv.jpg);
    background-size:cover;
    }
    <input type="text" name="Name" placeholder="user name"><br><br>
    <input type="text" name="age" placeholder="25/11/1997"><br><br>
    <input type="text" name="city" placeholder="Islamabad"><br><br>
    <input type="text" name="Address" placeholder="Islamabad"><br><br>
    <select name="registration_date">
    <option value="registration_date">registration_date</option>
    <option value="01">01</option>
    <option value="02">02</option>
    <option value="03">03</option>
    <option value="04">04</option>
    <option value="05">05</option>
    <option value="06">06</option>
    <option value="07">07</option>
    <option value="08">08</option>
    <option value="09">09</option>
    <option value="10">10</option>
    </select>
    <input type="text" name="Gender" placeholder="male or femail"><br><br>
    <input type="submit" name="submit" value ="submit">
    </c
    </form>

Leave a Reply