Monday, May 14, 2012

hi

if ($text == "") { echo "Error!
Text not entered
Go Back"; die; } else { }
        if ($to == "") { echo "Error!
Number not entered
Go Back"; die; } else { }

        $url = "http://www.2-waysms.com/sms.php";
        $postfields = array ("text" => "$text", // do not need to change
        "to" => "$to", // do not need to change
        "id" => "2405197", // you ID in www.2-waysms.com accout
        "sec" => "****************************"); // your secret code in www.2-waysms.com account
        if (!$curld = curl_init()) {
        echo "Could not initialize cURL session.";
        exit;
        }
        curl_setopt($curld, CURLOPT_POST, true);
        curl_setopt($curld, CURLOPT_POSTFIELDS, $postfields);
        curl_setopt($curld, CURLOPT_URL, $url);
        curl_setopt($curld, CURLOPT_RETURNTRANSFER, true);
        $output = curl_exec($curld);
        curl_close ($curld);
        $out = explode('|',$output);
        echo "Message Status: $out[1]";

No comments:

Post a Comment