Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
L

LogIn-SignUp

> 数据库
Open source

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 developer

100 stars0 likes2 views
WebsiteGitHub

About

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 developer

Secure LogIn and SignUp API in PHP

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

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPlogin-apiphp-apiphp-authenticationphp-login

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库