Advertisement
Guest User

Untitled

a guest
Mar 8th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <?php $url = 'http://www.wepay.in.th/อะไรก็ว่าไป';
  2. $myvars = sprintf('username=%s&password=%s&type=balance_inquiry', urlencode("ยูสเซอร์เนม"), urlencode('พาสเวิร์ด'));
  3.  
  4. $ch = curl_init( $url );
  5. curl_setopt( $ch, CURLOPT_POST, 1);
  6. curl_setopt( $ch, CURLOPT_POSTFIELDS, $myvars);
  7. curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
  8. curl_setopt( $ch, CURLOPT_HEADER, 0);
  9. curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
  10.  
  11. $response = explode('|', curl_exec( $ch ));
  12. echo "สถานะ=> {$response[0]}, ", ($response[0]=="SUCCESS"?"จำนวนเงินคงเหลือ {$response[1]} บาท":"ไม่สามารถใช้ได้ เพราะ {$response[1]}");?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement