Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $strPostURL='網站根目錄';
- $arrData=array(
- //'email' =>'jana@jana.bz', // WordPress 帳號 email
- 'mobile' =>'0932888999',
- 'user-id' =>'janalee.tw', // 自訂 user-id
- 'action' =>'custom-user-id',
- );
- $ch=curl_init();
- curl_setopt($ch, CURLOPT_URL, $strPostURL);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
- curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($arrData));
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
- curl_setopt($ch, CURLOPT_TIMEOUT, 30);
- $response=curl_exec($ch);
- if(curl_errno($ch)){
- $response['error'] =true;
- $response['message'] =curl_error($ch);
- }
- curl_close($ch);
- // 回傳資料範例: {"status":"OK","message":"\u66f4\u65b0\u5b8c\u6210"}
Add Comment
Please, Sign In to add comment