简体   繁体   English

从网站发送短信

[英]send SMS from website

I have google around and try to see if I could find something php server where you can see it on to mobile etc.. I have read me until that one must have an API code before you can do it. 我有谷歌周围,并试图看看我是否可以找到一些PHP服务器,你可以在移动设备上看到它..我已经读过我,直到你必须有一个API代码才能做到这一点。

Hope you can help me 希望你能帮我

Feel free to ask me if there's anything else you want to know? 随意问我是否还有其他想知道的事情?

i have to try its here: 我必须在这里尝试:

// Create a Clockwork object using your API key
$clockwork = new Clockwork( $key );

// Setup and send a message
$message = array( "to" => "441234567890", "message" => "Hello World" );
$result = $clockwork->send( $message );

// Check if the send was successful
if( $result["success"] ) {
    echo "Message sent - ID: " . $result["id"];
} else {
    echo "Message failed - Error: " . $result["error_message"];
}

I can in no way get it to work at all. 我根本无法让它工作。 it does not send any SMS. 它不发送任何短信。 and is download from here: http://www.clockworksms.com/ 并从这里下载: http//www.clockworksms.com/

I have no api and I do not go out and make money for it. 我没有api而且我不出去赚钱。 it is such that I come from Denmark ,. 这是我来自丹麦 ,。

EIDT! EIDT! :

function sms_server()
    {
        $number = $_POST["mobil"];
        $tekst = $_POST["tekst"];
        $clockwork = new Clockwork("785c853......");

        $message = array( "to" => $number, "message" => $tekst);
        $result = $clockwork->send( $message );

        if( $result["success"] ) {
            echo "Message sent - ID: " . $result["id"];
        } else {
            echo "Message failed - Error: " . $result["error_message"];
        }
    }


<form action="#" method="post">
            <table width="100%">
                <tr>
                    <td>nummer</td>
                    <td><input type="number" name="mobil"></td>
                </tr>
                <tr>
                    <td>Tekst</td>
                    <td><textarea name="sms" style="width:100%;"></textarea></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input type="submit" name="send" value="Send sms"></td>
                </tr>
            </table>
        </form>
        <?php
        if(isset($_POST["send"]))
        {
            $sms_server = $mebe->sms_server();
        }
        ?>

Have you signed up for an API key - it seems that having an API key is a must for use of this! 您是否已注册API密钥 - 似乎必须拥有API密钥才能使用此密钥! ( https://app5.clockworksms.com/signup ). https://app5.clockworksms.com/signup )。 You will need to assign the API key they give you to your $key variable. 您需要将他们提供的API密钥分配给$key变量。 Also if you're from Denmark, I'm really not sure that this will work for you as UK mobile numbers are used as examples in their documentation, although I am not sure(?). 此外,如果你来自丹麦,我真的不确定这对你有用,因为英国手机号码在他们的文档中用作例子,虽然我不确定(?)。 Actually possibly it'll be fine if you prefix your mobile number with the danish country code 实际上,如果您在移动电话号码前加上丹麦语国家代码,那么可能会没问题

replace $tekst = $_POST["tekst"]; 替换$ tekst = $ _POST [“tekst”];

with this code 用这个代码

$tekst = $_POST["sms"]; $ tekst = $ _POST [“sms”];

and create account with clockwock to get AP-KEY 并使用clockwock创建帐户以获取AP-KEY

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM