我正在尝试从 Zend - PHP 中的控制器发送短信。我使用 IntelliSMS,但它的库中有异常:/ 异常:
exception 'Exception' with message 'Problem making HTTP request
https://www.intellisoftware.co.uk/smsgateway/sendmsg.aspx, fopen(https://www.intellisoftware.co.uk/smsgateway/sendmsg.aspx)
[function.fopen]: failed to open stream: Invalid argument' in C:\xampp\htdocs\Story\library\IntelliSMS\SendScripts\IntelliSMS.php:302 Stack trace: #0
C:\xampp\htdocs\Story\library\IntelliSMS\SendScripts\IntelliSMS.php(199): IntelliSMS-
>MakeHTTPFormPost('https://www.int...', 'username=canib&...', 'Content-Type: a...') #1...
这很奇怪,因为我可以通过以下方式发送此短信:Get 方法:
http://www.intellisoftware.co.uk/smsgateway/sendmsg.aspx?username=MyUsername &password=MyPassword&to=44771012345,44771054321&text=TheMessage
但我不能使用这个 php Intellisms 库。你有什么主意吗?你知道如何使用 Zend 框架发送 Post Request 吗?我努力了:
$request->getResponse()->setRedirect('http://www.intellisoftware.co.uk/smsgateway/sendmsg.aspx?
username=xxx&password=xxx&to='.$number.'&text='.$text,302);
但什么也没发生:/
谢谢,
我的 php.ini 中有:allow_url_fopen = On