Skip to content

Instantly share code, notes, and snippets.

Working from home


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


Unauthorized access to a PHP page prompts the user for a password. Once the password is entered the original page will show.


  • The access is recorded in the session so it only needs to be
View gist:1ba55b7b674371ff3c521d911887ead2
<title>API Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src=""></script>
<script type="text/javascript">
var accessToken = "<your agent's client access token>";
var baseUrl = "";
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
// API access key from Google API's Console
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array