欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

关于php 发送短信到手机的有关问题

程序员文章站 2022-04-26 13:12:33
...
关于php 发送短信到手机的问题!
在 DEDE 里搞两个程序要发送短信通知用户,

发送函数这样的:

function sendmb( $mobile, $c, $name, $pwd )
{
$URL = "http://218.241.153.202:8888/post_sms.do";
$post_data['corp_id'] = "309090";
$post_data['user_id'] = $name ;
$pwd .= "td";
$pwd = md5( $pwd );
$post_data['MD5_td_code'] = $pwd ;
$post_data['mobile'] = $mobile ;
$post_data['msg_content'] = $c ;
$post_data['mesg_id'] = "";
$post_data['extend'] = "";
$URL_Info = parse_url( $URL );
foreach ( $post_data as $key => $value )
{
$values[] = "{$key}=".urlencode( $value );
}
$data_string = implode( "&", $values );
$URL_Info['port'] = 8888;
$request .= "POST ".$URL_Info['path']." HTTP/1.1\n";
$request .= "Host: ".$URL_Info['host']."\n";
$request .= "Referer: ".$referrer."\n";
$request .= "Content-type: application/x-www-form-urlencoded\n";
$request .= "Content-length: ".strlen( $data_string )."\n";
$request .= "Connection: close\n";
$request .= "\n";
$request .= $data_string."\n";
$fp = fsockopen( $URL_Info['host'], $URL_Info['port'] );
fputs( $fp, $request );
while ( !feof( $fp ) )
{
$result .= fgets( $fp, 1024 );
}
fclose( $fp );
$ret = explode( "close", $result );
return trim( $ret[1] );
}

调用:(号码我就不公开了哈...免得天天全国打过来挨骂)


sendmb("13#10101###","fuck ass","baby","abc123");



可是运行后没反应,请问怎么解决?

------解决方案--------------------
以前做过支付交易,登录投诉时候用过。对页面编码也是有要求的,你仔细看下,
关于php 发送短信到手机的有关问题

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。

相关文章

相关视频