Coder Social home page Coder Social logo

marciopocebon / login-signup Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vishnusivadasvs/login-signup

0.0 0.0 0.0 20 KB

A secure PHP API to manage login and signup operations. This API protects from attacks like SQL injunction and XSS. Making development work easier for developers.

PHP 100.00%

login-signup's Introduction

Secure LogIn and SignUp API in PHP

Vishnu Sivadas

A secure PHP API to manage login and signup operations. This API protects from attacks like SQL injunction and XSS. Making development work easier for developers.

How to use?

First of all download the files DataBase.php and DataBaseConfig.php. Place it in your project folder. Go to the DataBaseConfig.php file and change the details to your database details.Now add the file DataBase.php to your project file by requiring it.

require "DataBase.php";

Simply create an object for the class DataBase.

$db = new DataBase();

Call the dbConnect() and it will return a boolean value which shows whether the database connection is success of not.

$db->dbConnect();

Inside the current file check the condition for database connection. If it is true proceed with the rest. Check this sample code.

require "DataBase.php";
$db = new DataBase();
if ($db->dbConnect()) {
    //Database connection is success.
}
else{
    //Database connection is failed.
}

Now that the connection is success you can call the login and the signup functions. Use the object of the class DataBase and call the functions.

Calling Login Function

Call the logIn() with the object and pass the tablename, username and password as its arguments.

$db->logIn($tablename, $username, $password);

Calling Signup Function

Call the signUp() with the object and pass tablename, fullname, username, password and email as its arguments. You can also chnage the number of arguments as you want, but you will have to change signUp() in the DataBase class accordingly.

$db->signUp($tablename, $fullname, $username, $password, $email);

Feel free to report any issues related to this.

Authors

  • Vishnu Sivadas - Developer - Website

Check out my other works @VishnuSivadasVS

login-signup's People

Contributors

vishnusivadasvs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.