ยินดีต้อนรับคุณ, บุคคลทั่วไป กรุณา เข้าสู่ระบบ หรือ ลงทะเบียน

เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น

ThaiSEOBoard.comพัฒนาเว็บไซต์ProgrammingSMS..เเจ้งชําระค่าบริการ [ ขอคําเเนะนํา ]
หน้า: [1]   ลงล่าง
พิมพ์
ผู้เขียน หัวข้อ: SMS..เเจ้งชําระค่าบริการ [ ขอคําเเนะนํา ]  (อ่าน 1535 ครั้ง)
0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้
เป็นติ่งไรเนี่ย
หัวหน้าแก๊งเสียว
*

พลังน้ำใจ: 66
ออฟไลน์ ออฟไลน์

กระทู้: 1,210



ดูรายละเอียด
« เมื่อ: 19 พฤศจิกายน 2010, 23:16:40 »

พอดี..ที่ออฟฟิศ
จะทําเว็บขายของ ไกล้ทําเสร็จแล้ว เหลือเเต่
ระบบsms ที่ต้องการให้เเจ้งเตือน ส่งข้อความไปยังมือถือผู้สั่งซื้อ
เเสดงขอบคุณ และเเจ้งการชําระเงิน

ขอคําเเนะนําหน่อยคับ
เราจะต้องไปติดต่อกับใคร
ยังไงคับ
บันทึกการเข้า
room88
ก๊วนเสียว
*

พลังน้ำใจ: 26
ออฟไลน์ ออฟไลน์

กระทู้: 287



ดูรายละเอียด เว็บไซต์
« ตอบ #1 เมื่อ: 19 พฤศจิกายน 2010, 23:24:10 »

แนะนำ hxxp://www.thaibulksms.com/ จ้า  ที่ทำงานก็ใช้ตัวนี้อยู่ค่ะ  Embarrassed
บันทึกการเข้า

tdelphi
Global Moderator
หัวหน้าแก๊งเสียว
*****

พลังน้ำใจ: 308
ออฟไลน์ ออฟไลน์

กระทู้: 1,602



ดูรายละเอียด เว็บไซต์
« ตอบ #2 เมื่อ: 19 พฤศจิกายน 2010, 23:29:17 »

PM ไปละครับ
บันทึกการเข้า

Tee++;
โปรแกรมเมอร์ จอหงวน
หัวหน้าแก๊งเสียว
*

พลังน้ำใจ: 79
ออฟไลน์ ออฟไลน์

กระทู้: 1,861



ดูรายละเอียด เว็บไซต์
« ตอบ #3 เมื่อ: 19 พฤศจิกายน 2010, 23:30:38 »

คุณ tdelphi นี่ทำได้ทุกอย่างเลยแฮะ สงสัยอาจจะต้องมีขอใช้บริการ 555+
บันทึกการเข้า

เป็นติ่งไรเนี่ย
หัวหน้าแก๊งเสียว
*

พลังน้ำใจ: 66
ออฟไลน์ ออฟไลน์

กระทู้: 1,210



ดูรายละเอียด
« ตอบ #4 เมื่อ: 19 พฤศจิกายน 2010, 23:34:49 »



room88  +1จ้า

PM ไปละครับ

ขอบคุงมากคับ
ขอใช้บริการคนเเถวนี้ดีกว่า
อิอิ..
แล้วจะติดต่อไปนะฮะ

บันทึกการเข้า
ngohtitle
คนรักเสียว
*

พลังน้ำใจ: 8
ออฟไลน์ ออฟไลน์

กระทู้: 101



ดูรายละเอียด
« ตอบ #5 เมื่อ: 26 พฤศจิกายน 2010, 00:48:40 »

sms การส่งไม่ยากอย่างที่คิดคับ แต่ก่อนก็คิดว่ายากเหมือนกัน แต่ลองผิดลองถูกก็ทำได้ละ เดียวนี้ก็ทำให้เว็บของตัวเองส่ง sms ตามความต้องการได้แล้ว ลองเอาไปประยุกต์ใช้นะคับ

ลองสมัครส่ง sms จาก thaibulksms ฟรีไปก่อนคับ จากนั้นก็เอาโค้ดจากในเว็บมาเขียนใช้งานตามต้องการ

โค้ดตัวอย่างคับ ชื่อไฟล์ index.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns="http://www.w3.org/1999/xhtml ">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<p>ทดสอบการส่ง sms จากเว็บ THAIBULKSMS</p>
<form id="form1" name="form1" method="post" action="smsp.php">
  <table width="477" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="307">หมายเลขโทรศัพท์ปลายทาง</td>
      <td width="170"><label>
        <input name="txttel" type="text" id="txttel" />
      </label></td>
    </tr>
    <tr>
      <td>ข้อความ</td>
      <td><label>
        <textarea name="txtdetail" cols="40" rows="4" id="txtdetail"></textarea>
      </label></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><label>
        <input type="submit" name="Submit" value="ตกลง" />
      </label></td>
      <td><label>
        <input type="reset" name="Submit2" value="ยกเลิก" />
      </label></td>
    </tr>
  </table>
</form>
<p>&nbsp; </p>

<form id="form2" name="form2" method="post" action="http://www.thaibulksms.com/sms...password&tag=credit_remain " >
<input name="username" type="text" id="username" />
<input name="password" type="text" id="password" />
<input type="submit" name="Submit" value="ตกลง" />
</form>
</body>

</html>

ไฟล์ที่ 2 ชื่อ function.php //ไม่ต้องแก้ไขอะไรคับ
<?
class XmlToArray
{
   
   var $xml='';
   
   /**
    * Default Constructor
    * @param $xml = xml data
    * @return none
    */
   
   function XmlToArray($xml)
   {
      $this->xml = $xml;
   }
   
   /**
    * _struct_to_array($values, &$i)
    *
    * This is adds the contents of the return xml into the array for easier processing.
    * Recursive, Static
    *
    * @access    private
    * @param    array  $values this is the xml data in an array
    * @param    int    $i  this is the current location in the array
    * @return    Array
    */
   
   function _struct_to_array($values, &$i)
   {
      $child = array();
      if (isset($values[$i]['value'])) array_push($child, $values[$i]['value']);
      
      while ($i++ < count($values)) {
         switch ($values[$i]['type']) {
            case 'cdata':
               array_push($child, $values[$i]['value']);
               break;
               
            case 'complete':
               $name = $values[$i]['tag'];
               if(!empty($name)){
                  $child[$name]= ($values[$i]['value'])?($values[$i]['value']):'';
                  if(isset($values[$i]['attributes'])) {
                     $child[$name] = $values[$i]['attributes'];
                  }
               }
               break;
               
            case 'open':
               $name = $values[$i]['tag'];
               $size = isset($child[$name]) ? sizeof($child[$name]) : 0;
               $child[$name][$size] = $this->_struct_to_array($values, $i);
               break;
               
            case 'close':
               return $child;
               break;
         }
      }
      return $child;
   }//_struct_to_array
   
   /**
    * createArray($data)
    *
    * This is adds the contents of the return xml into the array for easier processing.
    *
    * @access    public
    * @param    string    $data this is the string of the xml data
    * @return    Array
    */
   function createArray()
   {
      $xml    = $this->xml;
      $values = array();
      $index  = array();
      $array  = array();
      $parser = xml_parser_create();
      xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
      xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
      xml_parse_into_struct($parser, $xml, $values, $index);
      xml_parser_free($parser);
      $i = 0;
      $name = $values[$i]['tag'];
      $array[$name] = isset($values[$i]['attributes']) ? $values[$i]['attributes'] : '';
      $array[$name] = $this->_struct_to_array($values, $i);
      return $array;
   }//createArray
   
   
}//XmlToArray



function xml($xml){
   $xmlObj    = new XmlToArray($xml);
   $arrayData = $xmlObj->createArray();
   return $arrayData;
}

function httpPost($ip=null,$port=80,$uri=null,$content=null) {
   if (empty($ip))         { return false; }
   if (!is_numeric($port)) { return false; }
   if (empty($uri))        { return false; }
   if (empty($content))    { return false; }
   // generate headers in array.
   $t   = array();
   $t[] = 'POST ' . $uri . ' HTTP/1.1';
   $t[] = 'Content-Type: application/x-www-form-urlencoded';
   $t[] = 'Host: ' . $ip . ':' . $port;
   $t[] = 'Content-Length: ' . strlen($content);
   $t[] = 'Connection: close';
   $t   = implode("\r\n",$t) . "\r\n\r\n" . $content;

   //
   // Open socket, provide error report vars and timeout of 10
   // seconds.
   //
   $fp  = @fsockopen($ip,$port,$errno,$errstr,10);
   // If we don't have a stream resource, abort.
   if (!(get_resource_type($fp) == 'stream')) { return false; }
   //
   // Send headers and content.
   //
   if (!fwrite($fp,$t)) {
      fclose($fp);
      return false;
   }
   //
   // Read all of response into $rsp and close the socket.
   //
   $rsp = '';
   while(!feof($fp)) { $rsp .= fgets($fp,8192); }
   fclose($fp);
   //
   // Call parseHttpResponse() to return the results.
   //
   return parseHttpResponse($rsp);
}

//
// Accepts provided http content, checks for a valid http response,
// unchunks if needed, returns http content without headers on
// success, false on any errors.
//
function parseHttpResponse($content=null) {
   if (empty($content)) { return false; }
   // split into array, headers and content.
   $hunks = explode("\r\n\r\n",trim($content));
   if (!is_array($hunks) or count($hunks) < 2) {
      return false;
   }
   $header  = $hunks[count($hunks) - 2];
   $body    = $hunks[count($hunks) - 1];
   $headers = explode("\n",$header);
   unset($hunks);
   unset($header);
   if (!validateHttpResponse($headers)) { return false; }
   if (in_array('Transfer-Coding: chunked',$headers)) {
      return trim(unchunkHttpResponse($body));
   } else {
      return trim($body);
   }
}

//
// Validate http responses by checking header.  Expects array of
// headers as argument.  Returns boolean.
//
function validateHttpResponse($headers=null) {
   if (!is_array($headers) or count($headers) < 1) { return false; }
   switch(trim(strtolower($headers[0]))) {
      case 'http/1.0 100 ok':
      case 'http/1.0 200 ok':
      case 'http/1.1 100 ok':
      case 'http/1.1 200 ok':
         return true;
         break;
   }
   return false;
}

//
// Unchunk http content.  Returns unchunked content on success,
// false on any errors...  Borrows from code posted above by
// jbr at ya-right dot com.
//
function unchunkHttpResponse($str=null) {
   if (!is_string($str) or strlen($str) < 1) { return false; }
   $eol = "\r\n";
   $add = strlen($eol);
   $tmp = $str;
   $str = '';
   do {
      $tmp = ltrim($tmp);
      $pos = strpos($tmp, $eol);
      if ($pos === false) { return false; }
      $len = hexdec(substr($tmp,0,$pos));
      if (!is_numeric($len) or $len < 0) { return false; }
      $str .= substr($tmp, ($pos + $add), $len);
      $tmp  = substr($tmp, ($len + $pos + $add));
      $check = trim($tmp);
   } while(!empty($check));
   unset($tmp);
   return $str;
}
?>

ไฟล์สุดท้าย สำคัญ อันนี้ต้องมีการเปลี่ยนแปลงบ้างคับ ชื่อไฟล์ smsp.php
<?
include("function.php");
define(_SERVER, 'www.thaibulksms.com ');
define(_PORT, '80');
define(_URI, '/sms_api.php');


// Username and password for ThaiBulkSMS Account
$username = "xxxxxxx";  //ในส่วนของ"xxxxxxx" ก็คือ username ที่ได้จากการสมัครสมาชิกจากเว็บ หรือได้ทำการซื้อเพคเก็จ sms จากเว็บของเขานะคับ         
$password = "xxxxxxx";  //ในส่วนของ"xxxxxxx" ก็คือ assword ที่ได้จากการสมัครสมาชิกจากเว็บ หรือได้ทำการซื้อเพคเก็จ sms จากเว็บของเขานะคับ

$txttel = $_POST['txttel']; //?Huh?Huh?Huh?Huh?Huh?Huh?? index.php
// Destination mobile number Huh?Huh?Huh?Huh?Huh?Huh?Huh??
$msisdn = "$txttel";

$txtdetail = $_POST['txtdetail'];
// Message to send, please ensure that your message has a UTF-8 charset. Huh?Huh?Huh?Huh?Huh?Huh??? sme
$message = "$txtdetail";


$Delivery_date=date("YYMMDDhhmmsssss");
// ScheduledDelivery, please read API document  Huh?Huh?  ?? Huh??? Huh? Huh?? Huh?Huh? +20532 090101010120532
$ScheduledDelivery = '$Delivery_date';


// Sender Name, please read API document  Huh?Huh?Huh?Huh?Huh?Huh?Huh?? Huh?Huh?Huh?Huh?Huh???     THAIBULKSMS
$sender = 'SMS.';


$data_string = "username=" . urlencode($username) . "&password=" . urlencode($password) . "&msisdn=" . urlencode($msisdn) . "&message=" . urlencode($message) . "&sender=" . urlencode($sender) . "&ScheduledDelivery=" . urlencode($ScheduledDelivery);
$result = httpPost( _SERVER , _PORT , _URI, $data_string);
if (!is_string($result)) {
   die("Fatal Error: Unable to connect to server.\n\n");
} else {
   $xml = xml($result);
   $count = count($xml['SMS']['QUEUE']);
   if($count > 0){
      $count_pass = 0;
      $count_fail = 0;
      $used_credit = 0;
      for($i=0;$i<$count;$i++){
         if($xml['SMS']['QUEUE'][$i]['Status']){
            $count_pass++;
            $used_credit +=
            $xml['SMS']['QUEUE'][$i]['UsedCredit'];
         }else{
            $count_fail++;
         }
      }
      if($count_pass > 0){echo "Success: $count_pass messages, Total: $used_credit credits\n";}
      if($count_fail > 0){echo "Fail: $count_fail messages\n";}
   }else{
      echo ("Error: ".$xml['SMS']['Detail']."\n\n");
   }   
}
?>
บันทึกการเข้า
Tee++;
โปรแกรมเมอร์ จอหงวน
หัวหน้าแก๊งเสียว
*

พลังน้ำใจ: 79
ออฟไลน์ ออฟไลน์

กระทู้: 1,861



ดูรายละเอียด เว็บไซต์
« ตอบ #6 เมื่อ: 27 พฤศจิกายน 2010, 23:22:26 »

http://www.twilio.com/

ตัวนี้เป็น API ระดับโลกครับ ทำงานได้หมดถ้าเกี่ยวกับโทรศัพท์ เชื่อมง่าย Document ดี เสียอย่างเดียวราคาสูงไปนิดนึง แต่ระบบ Report อะไรพวกนี้สุดยอดครับ ถือเป็น API ที่ติดอับดับ TOP 10 ที่มีคนเชื่อมใช้มากที่สุดในโลก
บันทึกการเข้า

หน้า: [1]   ขึ้นบน
พิมพ์