
Build a rest api with PHP and MySQL by creating endpoints for an article management app. Implement basic authentication and JWT, and test APIs with a rest client.
Start your rest api development journey with php and mysql, even with no prior knowledge, and prepare a computer with stable internet to learn.
Build a single-page PHP and MySQL REST API app with user registration and login, form validation, sticky data, and article management by category.
Download resources for each section, including code, databases, zip files, and slides, to reinforce learning; get help via questions boards, personal messages, or skype sessions.
Understand representational state transfer as transferring resource representations between client and server, using standard methods like get, put, and delete to interact with json or xml data.
Explore the six major constraints of rest, including client-server architecture, statelessness, cacheability, layered systems, on-demand client code, and a uniform interface. Also covers resource identification, representation, and hypermedia.
Explore how rest api requests relate to the hypertext draft protocol, and highlight the six constraints and the web resource that define a restful service.
Explore how rest api manages client requests and responses, enforces authentication and rate limits, and exposes data resources through a clear interface.
Explore the basics of the hypertext transfer protocol, its stateless request/response model, common http methods like get and post, and how cookies and headers enable session management.
explore http/1 and http/2, their speed and encryption differences, and how latest browsers and servers support them, including unencrypted fallbacks.
Explore essential web terminology, including browsers and user agents, and learn how URLs, IP addresses, servers, and proxies enable client–server communication in REST API development.
Explain how HTTP status codes guide server responses from 200 success to 500 errors, including redirects and client errors, and how requests, resources, and methods are managed.
Explore how HTTP headers carry information between the client and server, including authorization headers, cookies, and the user-agent, and how these headers support request and response flows in REST APIs.
Learn to build a php and mysql rest api driven interface with registration and login, including form validations, email checks, and automatic profile creation with a generated key.
Set up a local development environment by installing XAMPP, configuring Apache and MySQL via the XAMPP control panel, and verifying PHP execution by visiting localhost to access project folders.
Install an integrated development environment, compare popular editors, and set up a PHP API project, with bootstrap to style the application.
Install bootstrap through the csx framework, download and organize assets, and wire in jquery and popper to enable a responsive user interface. Verify by refreshing the browser and checking console.
Learn to integrate bootstrap components into a PHP app by adding a navigation bar, a centered container, and a sticky footer, with practical code comments for maintenance.
Create and attach a custom CSS file to the Bootstrap layout, style the navigation bar, footer, and focus container, and integrate a compact Bootstrap jumbotron for a cleaner page.
Create reusable navigation components and login and registration pages in a PHP app. Modularize with includes, style forms with Bootstrap, and enable dynamic form generation.
Learn to clean the url by configuring an .htaccess file with mod_rewrite on Apache, rewriting requests to hide the php extension and update navigation links (index.php, login, register).
Create a new database and an API user table with id, first_name, last_name, email, password, api_key, and status to support authentication and future connection.
Create a database class to manage a MySQL connection, defining host, user, password, and database name, then implement open connection, query, fetch, escape, and close methods.
Develop a PHP forms class to manage form creation, open form operations, input fields, and validation errors using private sticky data.
Explore building a user form in PHP, creating email and password inputs, a submit button, and implement validation with empty checks and email format using Bootstrap styling.
Explore PHP magic methods __get and __set to access non-existent or private properties, implement getters and setters, and build a forms class with email and password validation.
Create a helper PHP class in the includes folder to manage redirect headers and session flash messages, with private properties and get/set methods.
Create a dedicated api users model class to interact with the api_users table, load the database and blowfish encryption library, and organize models under a models folder.
Learn to build an api users model class that checks email uniqueness, hashes passwords with bcrypt, generates an authentication key, escapes input, and inserts new users with proper redirects.
Create and implement two api user functions: get_api_user_details to fetch user data by id, and check_user_credentials to verify login by comparing hashes, returning limited user fields without password.
Implement a verify key function in the API users model to authenticate a user by Odki, querying the database for API user info and returning true or false.
Create the API users registration page with a PHP form component, including first name, last name, email, and password inputs, using includes and a register action.
Build and validate a PHP registration form, handle POST data and password confirmation, check email uniqueness with the API user check email function, and insert the user into the database.
Explore registering api users with php and mysql, validate emails and passwords, display success flash messages, and redirect to the login page after registration.
Create a login flow and profile page in a php and mysql REST API project by building an email and password login form with redirect after login.
Implement a functional login form by validating inputs, authenticating with an API user class, establishing a session, and redirecting to the profile with flash feedback.
Create a user profile in PHP and MySQL by enforcing login checks, session handling, and bootstrap flash messages (success, warning, danger) while retrieving and displaying API user details.
Learn to implement logout with session handling, dynamic navigation, and redirects in a php and mysql api user site, showing profile or login options based on user authentication.
Create a user table and a corresponding php model to support the api endpoint, wiring in the database and preparing for subsequent api actions.
Create a php mysql user model by implementing validation functions that ensure input values are not empty. Validate emails for uniqueness through a database query to prevent duplicate registrations.
Create a create_user function that cleans input with trim and strip tags, hashes the password with bcrypt, and inserts first name, last name, email, and hashed password to register user.
Create a check user credentials function to validate email and password against the database, using hashing and a password verification library, and expose get user details for authenticated users.
Create your first api endpoint for user creation in a PHP and MySQL rest api, configure cors headers, and validate request type, content-type, and authentication key before inserting data.
Build a php and mysql rest api endpoint to create a user by validating post requests, authenticating via authorization header, decoding json, validating fields, and returning json responses.
Build a PHP REST API endpoint to check user credentials, handling POST requests with JSON payload, validating content type and authentication header, and invoking the check user credential function.
Build a php article model by creating an articles table (id, user_id, category_id, title, body, created, status) and a create article method to insert records for API endpoints.
We implement a get_user_articles function to retrieve all articles for a user via a get request, using joins across articles, users, and categories, with filtering by user id.
Explore article CRUD in a PHP and MySQL REST API: create, update, delete, and fetch articles with title, body, date, category, and user id.
Implement delete, update, and a latest articles function in PHP to fetch five newest articles by joining articles, categories, and users, ordered by id.
Create an article endpoint in a PHP and MySQL REST API, validating post requests, content type, and API user authentication to reliably insert new articles.
Develop an edit article endpoint in a php & mysql REST API, using a PUT request, JSON content-type, authentication, and update_article function to modify articles by article_id with validated fields.
Create a new delete article endpoint in php by copying the edit article endpoint, switch to a delete request, validate only the article id, and return a success message.
Implement the get latest articles endpoint in a PHP and MySQL REST API by handling a GET request, validating the authentication key, and returning articles in JSON.
Build a categories table and model in a PHP & MySQL REST API, defining category_id, category_name, category_status, then fetch categories with article counts using a left join and group by.
Implement a function to fetch articles by category using PHP and MySQL, joining articles with categories and users to return article titles and author names.
Create a function in the categories model class to fetch a list of categories for populating a form dropdown, returning the results from the database.
Develop the get categories endpoint for a php & mysql rest api by validating the authentication key, querying the categories table, and returning the results as json.
Create a new get category list endpoint in PHP to populate a dropdown when saving articles, using the category_list function and authentication to return a JSON response.
Create a post-based api endpoint to get articles by category in php and mysql, validating the auth header, decoding json input, and returning articles for the selected category.
Learn to build a dynamic single-page application with user registration, authentication, article creation, viewing, editing, and deletion, including permissions and basic validations.
Set up a single-file front-end template to consume the REST API built in the previous section, integrating bootstrap styling, article management components, and user info UI.
Design a two-form authentication template by building a login form with post action to a local PHP API, and lay out the container and register link.
Develop a registration form UI for a PHP and MySQL REST API, wiring create users with first name, last name, email, and password fields.
Learn to style the registration and login forms for a PHP and MySQL REST API project, building templates, styling labels and inputs, and applying cross-browser CSS with transitions.
Build a two-column template for a single-page app with article items and a category sidebar. Create articles through a bootstrap-styled form that posts to an API endpoint to save data.
Duplicate and extend the add article panel, implement post-based submission and article listing, and set up editing for title, description, and category while displaying articles and categories via endpoints.
Style the application template by applying absolute positioning, a minimum height, margins, and a background color, then implement display none defaults and introduce a freeloader and user info sections.
Implement a preloaded image as a freeloader in a single-page app, using a jQuery document ready script to fade it out, and add scripts to toggle login and registration forms.
Create an interactive single-page experience by implementing a login status check using local storage to show the login form or app page.
Develop the user registration feature by adding third-party plugins for notifications and accessibility, wiring bootstrap resources, and implementing a registration script that posts to the API endpoint in json.
Demonstrates a registration flow using AJAX to a PHP MySQL REST API, posting JSON with auth headers and handling responses for unique email and user creation.
Build and test a registration API by posting form data, validating email uniqueness, and confirming user creation via ajax requests and database entries.
Create and attach a login form module to power the user login process, then handle submission with an ajax call that sends JSON object containing email and password for verification.
Build an ajax request, sending email and password to the api, handling invalid credentials, then save user data in local storage and show the app page.
Test the login flow by diagnosing API endpoints, fixing database typos and spacing in the user model, and validating credentials via the network and local storage.
Implement a client-side log out flow by clearing local storage, updating views (log out form visibility), and reloading the page to reset the login state.
Build the create article ui by wiring an on click event to display the create panel and article list with slide down, and prepare for future edit forms.
Build a get categories api to retrieve categories from the database and populate a dynamic category list using an ajax get request.
Hook up the get categories API in the index to fetch categories. Fix content type handling and align database column names to ensure correct results.
Build the article form by fetching categories with AJAX from the API/categories/get_category_list, dynamically populating a dropdown, and including a hidden user_id from local storage for submission.
Test the get categories list function, wire it to the dropdown, fix API route and file naming, and prepare saving articles to the database.
Create article functionality in a single page application by posting via ajax using category id, article title, body, and user id. Harness the article form, data preparation, and api submission.
Complete the create article functionality by implementing an ajax call, handling authentication, processing success messages, showing notifications, validating input, and resetting the form while updating categories.
Test the create article workflow in a php and mysql rest api by validating category selection, calling get categories, and confirming article creation updates the database and ui counts.
Create a function to fetch articles by category and display them via ajax in a php and mysql powered rest api project.
Learn to implement an ajax post request to the API/categories endpoint to fetch articles by category, handle headers and data, process the response, and update the article section with templating.
Process the API response for get articles by categories, iterate through articles, and use templating to render each item with creator only edit and delete options.
Learn to fetch articles by category, wire up edit and delete actions, and assemble article fields (title, body, author, category) in the ui for testing rest api responses.
Test the get-articles-by-categories endpoint in a PHP & MySQL REST API, verifying category-specific article listings. Show category cards with previews and conditional edit/delete controls by authorship.
Demonstrates setting up the edit article workflow in a php and mysql rest api, including populating the edit form with current data and preparing ajax updates.
Implement an edit article workflow by performing an ajax request to fetch the category list, populate the dropdown in the edit form, and preserve the selected category for updates.
Learn to implement editing articles in a rest api, switch to update article logic, handle ajax requests, and validate responses from the edit article endpoint.
Implement delete article functionality with a confirmation prompt, send an ajax delete request using article id, category, and user, and handle success or error notifications from the delete articles endpoint.
Build and call a get latest articles function in a PHP and MySQL REST API. Implement article listing, editing, deleting, and updating flows in the UI.
Explore the basic authentication workflow for an API endpoint by validating the authorization header and credentials. A missing or invalid header returns a 401 not authorized, while credentials grant access.
See how to set up a basic authentication template for a REST API, including creating supporting files, integrating a base64 utility, and demonstrating authentication against an API endpoint.
Develop a basic authentication template, test it locally, and learn to send a post request with a basic auth header using base64 encoding and the application/json content type.
Implement basic authentication at a php rest api endpoint by parsing the authorization header, decoding base64 credentials, validating with a user object, and returning appropriate responses.
Test and debug basic authentication at an endpoint using correct headers and authorization logic, verify responses in the browser and console, and fix common typos and variable names.
Demonstrates implementing basic authentication on a predefined endpoint by passing an authorization header to fetch the latest articles, and testing authorization to secure the PHP and MySQL REST API.
Explore how JWT (JSON web token) provides compact, self-contained authentication by signing header and payload with a secret or key pair, enabling authorization and secure information exchange.
Secure a php and mysql rest api by setting up a jwt template: install firebase/php-jwt with composer and build a basic consumption endpoint using cookies.
Create a PHP post endpoint that validates an authentication key, generates a JWT token using the JWT library, and returns it for subsequent API requests.
Learn to implement jwt-based authorization in a PHP and MySQL rest api by generating a three-part token (header, payload, signature), configuring the authorization header and cookies, and validating post requests.
Implement JWT authentication at a PHP endpoint by extracting the token from the Authorization header, validating and decoding the JWT, and handling errors to secure article requests.
Learn how to consume JWT-secured APIs by sending requests with an authentication key and authorization header, manage tokens in cookies, and refresh tokens for testing access.
Learn how Guzzle simplifies building and consuming REST API in PHP, enabling streaming requests and responses, large uploads and downloads, and cookie management.
Install Guzzle with Composer, configure a PHP project, create a Guzzle client, send a GET request to a fake online API, and display status code and formatted response body.
Learn how to make simple and complex http requests with Guzzle, configure a base url, switch between get and post, and handle responses for a rest api in php.
Learn to make asynchronous requests with guzzle in php, using promises, then and catch, and how to wait for the promise to resolve.
Learn to perform concurrent requests with Guzzle by creating multiple asynchronous promises, waiting for all with promise settle, and processing results efficiently.
Build a Guzzle-based query string to fetch and format data from a PHP and MySQL API, using user id and post id parameters.
Learn how to send data to an API using a post request with JSON payloads, including setting title and user id fields, and verify responses with status codes.
Practice handling Guzzle responses by fetching the response body, decoding JSON, and displaying user data while translating status codes into words and using conditional logic.
Explore how to extract and format response headers, print them clearly, and decode the response body when the content type is application/json, using a PHP approach.
Learn how to handle Guzzle exceptions in PHP using try and catch to manage client and server errors, inspect status codes, and display messages.
This course focuses upon teaching REST API development and its concepts, also teaching to build the same using php (without the use of any php framework) and mysql.
This course broadly covers the following concepts:-
Authorization keys
Basic Auth
JWT ( JSON web tokens )
API Consumption
Building Single Page App
Creating a dynamic HTML single page app
Testing the API
This course comes with one Bonus section of GUZZLE (Guzzle is a PHP HTTP client that makes working with API's fun)
Hence this course is loaded with lots of information and techniques for any one who wants to learn REST API Development.