Skip to content

sahapranta/php-rest-api

Repository files navigation

PHP-Rest_api [CRUD]

This is completely in raw php using OOP and class based features.

Run PHP server from this directory > php -S localhost:3000

Routes

Route Links Type
Create http://localhost:3000/create_user.php POST
Read http://localhost:3000/read_all_user.php
http://localhost:3000/read_one_user.php?id=id
GET
Update http://localhost:3000/update_user.php PUT/POST
Delete http://localhost:3000/delete_user.php DELETE/POST
Search http://localhost:3000/search.php?s=query-string GET
Pagination http://localhost:3000/read_paging.php GET

Database Structure MYSQL with PDO

  • User
    1. id [auto increment]
    2. username [unique]
    3. password
    4. created_at [default timestamp]

In Search route id and username can be searched. Update route can handle both username and password update or anyone update.

{
    id:1,
    username:"any name",
    password:"xxxxxxxx"
}

TODO

  • Password hashing
  • Email Verify
  • Password Recovery
  • Security and Bug Fixing

Inspired From : codeofaninja

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages