-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathussd.php
More file actions
26 lines (26 loc) · 788 Bytes
/
ussd.php
File metadata and controls
26 lines (26 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
// Reads the variables sent via POST from our gateway
$sessionId = $_POST[""];
$serviceCode = $_POST["*384*789456#"];
$phoneNumber = $_POST[""];
$text = $_POST["text"];
if ( $text == "" ) {
$response = "CON What would you want to check \n";
$response .= "1. Hello \n";
$response .= "2. AT";
}
else if ( $text == "1" ) {
// Business logic for first level response
$response = "END Hello $phoneNumber !!";
}
else if($text == "2") {
$response = "END This is AT";
}
else{
$response = "END Sorry code not found";
}
// Print the response onto the page so that our gateway can read it
header('Content-type: text/plain');
echo $response;
// DONE!!!
?>