Purpose
Unauthorized access to a PHP page prompts the user for a password. Once the password is entered the original page will show.
Features
- The access is recorded in the session so it only needs to be
<?php | |
//Declare the Connection Credentials | |
$servername = 'localhost'; //or IP address for DB hosted elsewhere | |
$username = 'root'; | |
$password = ""; | |
$database = "ussd"; | |
$dbport = 3306; | |
// Create connection | |
$db = new mysqli($servername, $username, $password, $database, $dbport); | |
// Check connection, if there is an error end the USSD connection |
<?php | |
/* Simple sample USSD registration application | |
* USSD gateway that is being used is Africa's Talking USSD gateway | |
*/ | |
// Print the response as plain text so that the gateway can read it | |
header('Content-type: text/plain'); | |
/* local db configuration */ | |
$dsn = 'mysql:dbname=dbname;host=127.0.0.1;'; //database name |
Unauthorized access to a PHP page prompts the user for a password. Once the password is entered the original page will show.
<html> | |
<head> | |
<title>API Example</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<script type="text/javascript"> | |
var accessToken = "<your agent's client access token>"; | |
var baseUrl = "https://api.api.ai/v1/"; |
<?php | |
// API access key from Google API's Console | |
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' ); | |
$registrationIds = array( $_GET['id'] ); | |
// prep the bundle | |
$msg = array |