0

当用户提交表单时我需要发送一条短信,我有 2 种方式通过 javascript 发送它

$.ajax({
        url: encodeURI('http://gate.smsaero.ru/send/?user=myuser&password=mypassword&to=4920942894&text=test&from=fromTest'),
        type: 'GET',
        crossDomain: true,
        dataType: 'jsonp',
        success: function() { alert("Success"); },
        error: function() { alert('Failed!');
 }

但是在这里我有一个问题,我收到有关登录名和密码不正确的错误,这是编码问题还是可能是什么?

或者通过带参数的php发送但主机不提供CURL库,我该如何发送?

4

1 回答 1

0

在 PHP 中,您可以尝试:

$result = file_get_contents('http://gate.smsaero.ru/send/?user=myuser&password=mypassword&to=4920942894&text=test&from=fromTest');
于 2013-01-15T08:41:23.833 回答