- WebDev
- What is CSS?
- What is Javascript?
- What is HTML?
- What is PHP?
- Class
- $_SERVER
- JWT
- PHP Email
- REST API
- OAuth
- Configuration Files
- PHP Strings
- Youtube Templates
- Session - MySQL Handler
- PHP Router
- function keygen()
- MySQL
- Daemon Process
- Symbolic Links
- Date & Time
- Timezone
- File Upload
- What is XML?
- What is HTTP?
- What is SEO?
- What is the Internet?
- What is Java?
- What is RSS?
- What is a vCard?
- UKRAINE
- What is RFC?
- What is Apache?
Rest API
- REST (Representational State Transfer)
- An architecture that defines a set of methods to access to provided web services with the goal of creating accessiblity for multiple applications.
- API (Application Programming Interface)
- A collection of protocols and tools defining functions and variables that communicate with a database for making a software application.
The REST API is created with CRUD (Create, Read, Update, Delete) operations. The REST API is consumed by making an HTTP request (GET, POST, PUT or DELETE) from the client side. The API is implemented in manner to return a response in JSON, XML, or any other format.
class Database{
private $host = 'localhost';
private $user = 'root';
private $password = "password";
private $database = "demo";
public function getConnection(){
$conn = new mysqli($this->host, $this->user, $this->password, $this->database);
if($conn->connect_error){
die("Error failed to connect to MySQL: " . $conn->connect_error);
} else {
return $conn;
}
}
}