Home >Backend Development >PHP Tutorial >PHP sends SMS code for free (using China Mobile Fetion) (1/3)_PHP tutorial
PHP sends SMS code for free (using China Mobile Fetion)
php tutorial sends SMS code for free (using China Mobile Fetion)
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);
}
}
?>
Untitled Document
1 2 3
http://www.bkjia.com/PHPjc/444872.html
www.bkjia.com