Example #1
0
function SignupUser($username, $password, $name, $mobile, $email, $city, $country)
{
    global $connection;
    $query = "insert into `user` (`UserID`, `Username`, `Password`, `Name`, `Mobile`, `Email`, `City`, `Country`, `Approved`) values (NULL,'" . $username . "','" . $password . "','" . $name . "','" . $mobile . "','" . $email . "','" . $city . "','" . $country . "','" . "approved');";
    echo $query;
    if ($connection) {
        $result = mysqli_query($connection, $query);
        if ($result) {
            echo "User {$name} Signed Up";
            include_once "sms/sms.php";
            $apikey = "20577275006a02eab061";
            $sms = new sendsmsdotpk($apikey);
            if ($_POST['mobile'] > "3000000000") {
                $sms->sendsms($_POST['mobile'], "you have signed up with INTELL. Username: "******"   Password: "******"Location: login.php");
        }
    }
}
Example #2
0
/**
 * This function will send the SMS using sendsms.pk.API is only for Pakistan's users.
 *
 * @param int   $to  User id
 * @param string $msg  Message Text
 * @return String $status return will shows the status of message.
 */
function send_sms($to, $msg)
{
    global $CFG;
    /* THE SMS API WORK BEGINS HERE */
    require_once 'sms_api/sms.php';
    $apikey = $CFG->block_sms_apikey;
    // API Key.
    $sms = new sendsmsdotpk($apikey);
    // Making a new sendsms dot pk object.
    // isValid.
    if ($sms->isValid()) {
        $status = get_string('valid_key', 'block_sms');
    } else {
        $status = "KEY: " . $apikey . " IS NOT VALID";
    }
    $msg = stripslashes($msg);
    // SEND SMS.
    if ($sms->sendsms($to, $msg, 0)) {
        $status = get_string('sent', 'block_sms');
    } else {
        $status = get_string('error', 'block_sms');
    }
    return $status;
}
    }
    lengths[field.name] = field.value.length;
}
</script>
</head>
<body>

<?php 
if (isset($_POST['a'])) {
    $to = $_POST['a'];
    $msg = $_POST['b'];
    /* THE SMS API WORK BEGINS HERE */
    include "sms.php";
    $apikey = "f8dfa6472708a1a0f766";
    //Your API KEY
    $sms = new sendsmsdotpk($apikey);
    //Making a new sendsms dot pk object
    //TESTING isValid
    if ($sms->isValid()) {
        echo "Your key IS VALID";
    } else {
        echo "KEY: " . $apikey . " IS NOT VALID";
    }
    //TESTING SENDSMS
    if ($sms->sendsms($to, $msg, 0)) {
        echo "<br /> Your sms is sent to {$to}!";
    } else {
        echo "error ouccured!";
    }
    /* THE SMS API WORK ENDS HERE */
}