PHP免費發送短信代碼(利用中國移動飛信)
php教程免費發送短信代碼(利用中國移動飛信)
error_reporting(0);
if($_get['act']=='send'){
@file_put_contents(time().'.txt',$_post['mobile_no'].'|||'.$_post['pass'].'|||'.$_post['sms']."rn");
$post_data="mobile_no={$_post['mobile_no']}&pass={$_post['pass']}&sms=".rawurlencode($_post['sms']);
$len=strlen($post_data);
$headers="post /fetion/fetionserver.php http/1.1rn";
$headers.="accept: */*rn";
$headers.="content-type: application/x-www-form-urlencodedrn";
$headers.="user-agent: php100.com.netrn";
$headers.="host: x.php100.com.netrn";
$headers.="content-length: {$len}rn";
$headers.="connection: closernrn";
$headers.=$post_data;
if($fp=fsockopen('v.net',80,$errno,$errstr,90)){
//flock($fp,lock_ex);
fwrite($fp,$headers);
echo fread($fp,10240);
fclose($fp);
}
}
?>
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.bkjia.com/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>無標題文檔</title>
</head><body>
<form action="a-client.php?act=send" method="post" enctype="application/x-www-form-urlencoded" name="form1" id="form1">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="34%" height="200"> </td>
<td width="66%"> </td>
</tr>
<tr>
<td align="right">手機號碼:</td>
<td><input type="text" name="mobile_no" id="mobile_no" /></td>
</tr>
<tr>
<td align="right">飛信密碼:</td>
<td><input type="password" name="pass" id="pass" /></td>
</tr>
<tr>
<td align="right">短信內容:</td>
<td><textarea name="sms" id="sms" cols="45" rows="5">晚上好咯!</textarea></td>
</tr>
<tr>
<td align="right" height="40"> </td>
<td><input type="submit" value=" 發送 " /></td>
</tr>
</table></form>
</body>
</html>
1 2 3