PHP
This guide will show you how to implement the user authentication in a PHP application. For this tutorial, we will use the PHP demo from GitHub and show you step by step how to run it.
Prerequisites
This tutorial assumes you have:
- Basic knowledge of HTML/CSS
- PHP 6 or later
- Composer
Setup Your Dashboard
Get your credentials and whitelist your application domain as explained in this section. This is a mandatory step to successfully implement and run the demo.
Start with Auth Page (IDX) demo
You can clone the Auth Page demo repository on your system using below commands:
With SSH
git clone git@github.com:LoginRadius/login-page-demos.gitWith https
git clone https://github.com/LoginRadius/login-page-demos.gitNow move to the directory PHP demo using terminal
cd login-page-demo/php-idx-demo/This is the file structure you will get in the PHP Demo, let's see what each file does
demo folder - Contains all the HTML, CSS and JS file to create UI for the test application.
ajax_handler - Contains server side code and routing API to be used in demo
src folder - contains the required LoginRadius SDK functions to work with demo
.
+-- demo
| +-- ajax_handler/
| +-- assets/
| --- index.html
| --- profile.html
| --- resetpassword.html
-- src/LoginRadiusSDK/
--- composer.json- Set your LoginRadius credentials on the client and server side in the following files
Server side:
demo/ajax_handler/config.php<?php define('LR_API_KEY', 'LoginRadius API Key'); define('LR_API_SECRET', 'LoginRadius API Secret'); // Pass API Secret KeyClient side:
demo/js/options.js
commonOptions.apiKey = "<LoginRadius API Key>";
commonOptions.appName = "<App Name>";Upload the complete folder in your server wrapped in directory
Now run your application in your web browser http://localhost:3000/demo
Once you click on login button it will redirect you to auth page.

Features implemented in demo
- Login with Auth Page (IDX)
- Registration with Auth Page (IDX)
- Email Verification
- Forgot Password
- Reset Password
Discover More
Discover More on
- Add/Update Email Templates
- Customize Your Login Page
- Work with SOTT
How To Guides
- Implement SMTP Configuration
- Implement Social Login