1. Form Transfer page
<?phpsession_start (); error_reporting (E_all & ~e_notice);? ><! doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "HTTP// Www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> 2. Data processing page, (send SMS verification)
<?phpsession_start ();include "topsdk.php";d ate_default_timezone_set (' Asia/shanghai ');//Generate Random Verification code $srand = rand (1000,9999); $_session[' Rand ']= $srand;//Generate Cache Time if (isset ($_session[' time '))//Determine cache duration { $_session[' time ';} else { $_session[' time '] = date ("y-m-d h:i:s");} $rand = $_session[' rand ']; $c = new topclient; $appkey = ' XXX ';//Your appkey $secret = ' XXXX ';//Your secret //$phone = ' XXXXXX '; $phone =$_ post["Tel"];//get mobile number $c->appkey = $appkey; $c secretkey = $secret; $req = new alibabaaliqinfcsmsnumsendrequest; $req->setextend (""); $req- >setsmstype ("normal"); $req->setsmsfreesignname ("XX");//Your SMS verification signature $req Setsmsparam ("{number: ' $rand '}"); $req->setrecnum ($phone); $ Req->setsmstemplatecode ("XX");//Your SMS template id $resp = $c->execute ($req); >
PHP Dream Network Technology SMS Platform mobile phone SMS verification function realization