Skip to content

JehanKandy/OOP-Login-and-Sign-up-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OOP-Login-and-Sign-up-System

Object oriented Login and Sign up System

Explain Functions

function file

I develop this system using Object oriented PHP and PDO - PHP Data Objects

more about OOP PHP and PDO

now i am going to create connection between php and Database

config.php

<?php
    define('HOST','localhost');
    define('USER','root');
    define('PASS','');
    define('DB_NAME','oop_login');

    try{
        $conn = new PDO("mysql:host=".HOST.";dbname=".DB_NAME, USER, PASS);
    }

    catch (PDOException $e){
        exit("ERROR: ". $e->getMessage());
    }
?>

firstly i define HOST, USER, PASS, DB_NAME and assign localhost as server, root as user, null or empty as password, and oop_login as database name

then

    try{
        $conn = new PDO("mysql:host=".HOST.";dbname=".DB_NAME, USER, PASS);
    }

and i use try key word for make connection between php and database using $conn = new PDO("mysql:host=".HOST.";dbname=".DB_NAME, USER, PASS); as new PDO (PDO - PHP Data Objects)

if there are any errors while make connection between php and database it follow up content of catch keyword

    catch (PDOException $e){
        exit("ERROR: ". $e->getMessage());
    }

Development Timeline

03 January 2023

  • start Project
  • index.php
  • css/style.css
  • lib/layouts/header.php
  • lib/layouts/footer.php
  • lib/views/login.php
  • lib/views/reg.php
  • lib/function/function.php
  • lib/function/config.php

Developers

JehanKandy

Copyright and license

Copyright 2021–2023 JehanKandy. OOP Login released under the MIT License