Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Working from home

SABTECH SABTECH

💻
Working from home
View GitHub Profile
@SABTECH
SABTECH / dbconnect.php
Created Oct 20, 2018 — forked from JaniKibichi/dbconnect.php
How to connect a USSD to a MYSQL DB
View dbconnect.php
<?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
@SABTECH
SABTECH / index.php
Created Oct 20, 2018 — forked from abel-masila/index.php
A simple USSD registration application written in PHP
View index.php
<?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
@SABTECH
SABTECH / README.md
Created Aug 12, 2018 — forked from eric1234/README.md
Protect page with simple password
View README.md

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
View gist:1ba55b7b674371ff3c521d911887ead2
<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/";
@SABTECH
SABTECH / gist:4cf9de3440787d95fa68
Created Nov 28, 2015 — forked from prime31/gist:5675017
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
View gist:4cf9de3440787d95fa68
<?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