Jan. 09
28

เขียนโค้ด ส่ง SMS เข้ามือถือ แบบฟรีๆ

ทริปนี้ เราจะแอบเอาความสามารถของ google calendar มาใช้ หลายท่านคงทราบอยู่แล้วว่า google calendar นั้น มีฟังก์ชั่นเตือนเหตุการณ์ล่วงหน้า  ด้วย SMS และมี API ให้เราใช้  เราจะใช้ช่องตรงนี้แหละครับ  มาทำให้โปรแกรมเราส่ง SMS หาเราเมื่อมีคอมเม้นท์ใหม่ หรือว่ามีเหตุการณ์อันใดเกิดขึ้น สักอย่างกับเว็บเรา ลองดูโมเดล คร่าวๆ

 

send SMS model

 

1.ต้องมีแอคเค้าของ google และ เซต SMS

 

สำหรับใช้ google calendar และต้องตั้งให้ google calendar ส่ง SMS หาเราได้ ผมคงจะไม่กล่าวขั้นตอนนี้เอง เพราะมีท่านอื่นๆ ได้เขียนไว้ละเอียดแล้ว สามารถอ่านได้ที่

http://www.9tana.com/node/google-calendar/ หรือที่นี่ http://gotoknow.org/blog/krunapon/118353 ย้ำนะครับว่าต้องเซ็ตขั้นตอนนี้ให้เรียบร้อย สำหรับบางเครือข่ายโทรศัพท์ ไม่สามารถใช้คุณสมบัตินี้ได้ เพราะ google calendar ยังไม่ซัพพอร์ต ก็ต้องแสดงคำว่า เสียใจด้วย แต่ถ้าอยากจะทดสอบ ทดลอง เอาโดเรม่อนไปแลกซิม ทรูมูฟ จากเซเว่นมาสักซิม ก็ได้ครับ

 

 

2.ดาวน์โหลด Zend Gdata

ไลบรารี่นี้ทำให้เราเขียนติดต่อกับ google calendar ได้ ง่ายและสะดวก

ZendGdata-1.7.3.zip

 

 

3.แตกซิป Zend Gdata

ในโฟลเดอร์ ZendGdata-1.7.2 จะมีทั้ง document และโค้ดตัวอย่างมากมาย  แต่สิ่งที่เราต้องใช้คือสิ่งที่อยู่ในโฟลเดอร์ ZendGdata-1.7.2libraryZend ก้อปปี้มาใช้ทั้งโฟลเดอร์ Zend เลยนะครับ

 

 

4.สร้างฟังก์ชั่นสำหรับติดต่อกับ google calendar

มันก็คือฟังก์ชั่นที่ใช้เพิ่มรายการ เข้าไปใน google calendar และตั้งเวลาให้ส่ง SMS หาเรา โดยในฟังก์ชั่นนี้ผม ให้ใส่รายการไป ณ.เวลาปัจจุบัน+3 นาที และให้แจ้งเตือนก่อนถึงรายการนี้ 2 นาที เพราะฉะนั้นเมื่อ + – แล้ว หลังสคริปเรารันจบ ประมาณ 1 นาที จะต้องมี SMS หาเรา

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
function send_sms( $param_google_username , $param_google_password,$param_title,$param_content ){
 
	/**
	 * @Include Zend_Loader
	 */
	require_once 'Zend/Loader.php';
 
	/**
	 * @Load Zend_Gdata
	 */
	Zend_Loader::loadClass('Zend_Gdata');
 
	/**
	 * @Load Zend_Gdata_AuthSub
	 */
	Zend_Loader::loadClass('Zend_Gdata_AuthSub');
 
	/**
	 * @Load Zend_Gdata_ClientLogin
	 */
	Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
 
	/**
	 * @Load Zend_Gdata_HttpClient
	 */
	Zend_Loader::loadClass('Zend_Gdata_HttpClient');
 
	/**
	 * @Load Zend_Gdata_Calendar
	 */
	Zend_Loader::loadClass('Zend_Gdata_Calendar');
 
	// Parameters for ClientAuth authentication
	$service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
	$user = $param_google_username ;
	$pass =$param_google_password ;
 
	// Create an authenticated HTTP client
	$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);
 
	// Create an instance of the Calendar service
	$service = new Zend_Gdata_Calendar($client);
 
	// Create a new entry using the calendar service's magic factory method
	$event= $service->newEventEntry();
 
	// Populate the event with the desired information
	// Note that each attribute is crated as an instance of a matching class
	$event->title = $service->newTitle( $param_title );
 
	//$event->where = array($service->newWhere("Mountain View, California"));
	$event->content = $service->newContent( $param_content );
 
	// Set the date using RFC 3339 format.
	$startDate = date( "Y-m-d" );//"2009-01-15";
	$startTime = date( "H:i" , strtotime("+3 minutes") );
	$endDate = date( "Y-m-d" );
	$endTime = date( "H:i" , strtotime("+6 minutes") );
	$tzOffset = "+07";
 
	$when = $service->newWhen();
	$when->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00";
	$when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
 
	// Create a new reminder object. It should be set to send an email
	// to the user 10 minutes beforehand.
	$reminder = $service->newReminder();
	$reminder->method = "sms";
	$reminder->minutes = "2";
 
	$when->reminders = array($reminder);
 
	$event->when = array($when);
 
	// Upload the event to the calendar server
	// A copy of the event as it is recorded on the server is returned
	if ($newEvent = $service->insertEvent($event)){
 
		return true ;
	}else{
 
		return false;
	}
 
}?>

 

ฟังก์ชั่นนี้ผมส่งพารามิเตอร์เข้าไป 5 ตัว เขียนไว้เป็นฟังก์ชั่นเวลาเรียกใช้งานจะได้สะดวก

$param_google_username – username ที่ใช้ล้อกอินเข้ากูเกิล

$param_google_password – password ที่ใช้ล้อกอินเข้ากูเกิล

$param_title – หัวข้อรายการ

$param_content – เนื้อหาที่เราจะให้ส่ง sms หาเรา

 

 

5.ส่ง SMS

87
88
89
90
91
92
93
94
95
<?php
$google_username = "xxxxxxxxxxx"; // username เข้ากูเกิลของคุณ
$google_password = "xxxxxxxxxxx"; // password เข้ากูเกิลของคุณ
$title = "เรื่องนี้ต้องขยาย";
$content = "เนื่องจากนางสมศรีแอบรักกับนายสมชาย โดยพ่อสมปองไม่ทราบ"; 
 
// ส่ง SMS
send_sms( $google_username , $google_password , $title ,$content );
?>

 

6.Final โค้ดทั้งหมด จะเป็นดังนี้

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
function send_sms( $param_google_username , $param_google_password,$param_title,$param_content ){
 
	/**
	 * @Include Zend_Loader
	 */
	require_once 'Zend/Loader.php';
 
	/**
	 * @Load Zend_Gdata
	 */
	Zend_Loader::loadClass('Zend_Gdata');
 
	/**
	 * @Load Zend_Gdata_AuthSub
	 */
	Zend_Loader::loadClass('Zend_Gdata_AuthSub');
 
	/**
	 * @Load Zend_Gdata_ClientLogin
	 */
	Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
 
	/**
	 * @Load Zend_Gdata_HttpClient
	 */
	Zend_Loader::loadClass('Zend_Gdata_HttpClient');
 
	/**
	 * @Load Zend_Gdata_Calendar
	 */
	Zend_Loader::loadClass('Zend_Gdata_Calendar');
 
	// Parameters for ClientAuth authentication
	$service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
	$user = $param_google_username ;
	$pass =$param_google_password ;
 
	// Create an authenticated HTTP client
	$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);
 
	// Create an instance of the Calendar service
	$service = new Zend_Gdata_Calendar($client);
 
	// Create a new entry using the calendar service's magic factory method
	$event= $service->newEventEntry();
 
	// Populate the event with the desired information
	// Note that each attribute is crated as an instance of a matching class
	$event->title = $service->newTitle( $param_title );
 
	//$event->where = array($service->newWhere("Mountain View, California"));
	$event->content = $service->newContent( $param_content );
 
	// Set the date using RFC 3339 format.
	$startDate = date( "Y-m-d" );//"2009-01-15";
	$startTime = date( "H:i" , strtotime("+3 minutes") );
	$endDate = date( "Y-m-d" );
	$endTime = date( "H:i" , strtotime("+6 minutes") );
	$tzOffset = "+07";
 
	$when = $service->newWhen();
	$when->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00";
	$when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
 
	// Create a new reminder object. It should be set to send an email
	// to the user 10 minutes beforehand.
	$reminder = $service->newReminder();
	$reminder->method = "sms";
	$reminder->minutes = "2";
 
	$when->reminders = array($reminder);
 
	$event->when = array($when);
 
	// Upload the event to the calendar server
	// A copy of the event as it is recorded on the server is returned
	if ($newEvent = $service->insertEvent($event)){
 
		return true ;
	}else{
 
		return false;
	}
 
}
 
$google_username = "xxxxxxxxxxx"; // username เข้ากูเกิลของคุณ
$google_password = "xxxxxxxxxxx"; // password เข้ากูเกิลของคุณ
$title = "เรื่องนี้ต้องขยาย";
$content = "เนื่องจากนางสมศรีแอบรักกับนายสมชาย โดยพ่อสมปองไม่ทราบ"; 
 
// ส่ง SMS
send_sms( $google_username , $google_password , $title ,$content );
 
?>

 

ส่งท้าย

ความสำคัญทั้งหมดจะอยู่ที่ ฟังก์ชั่น send_sms ถ้าคุณจะทดสอบโค้ดชุดนี้ในเครื่องของคุณ ต้องมั่นใจนะครับว่า คุณได้เปิด OpenSSL ใน php.ini ไว้เรียบร้อย

 

โค้ดชุดนี้สามารถเอาไปประยุกต์ เป็นระบบส่ง SMS ภายในองค์กร หรือในกลุ่มเพื่อน สาเหตุที่บอกว่าประยุกต์ใช้เป็นกลุ่มอย่างนี้ เพราะว่าคุณต้องรู้ username กับ password google ของเขา จึงสามารถไปสร้างรายการแจ้งล่วงหน้าด้วย SMS ใน google calendar ของเขาได้

 

อ้างอิง : การใช้งาน google calendar API อย่างละเอียด

**** ย้ำเตือนนะครับ ****

  1. ต้องใช้ UTF-8 เท่านั้น
  2. ส่วนเรื่องเวลา จะขึ้นอยู่กับว่าโฮสต์ของท่านตั้งอยู่ประเทศไหน ถ้าไม่ได้อยู่ในไทย ก็แก้ตรงนี้ $tzOffset = “+07″;

บทความน่าสนใจ

  1. Google calendar
  2. jQuery ปฎิทิน
  3. แจกโค้ด php คำนวณอายุ
This entry was posted in PHP and tagged . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย

174 Comments

  1. Phet Firefox 3.0.6 Windows XP
    Posted 15/02/2009 at 12:11 | Permalink

    ในโฟลเดอร์ ZendGdata-1.7.2 จะมีทั้ง document และโค้ดตัวอย่างมากมาย แต่สิ่งที่เราต้องใช้คือสิ่งที่อยู่ในโฟลเดอร์ ZendGdata-1.7.2libraryZend ก้อปปี้มาใช้ทั้งโฟลเดอร์ Zend เลยนะครับ

    —โฟลเดอร์ Zend ต้อง copy ไปวางไว้ที่ไหนครับ

  2. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.0.6 Windows XP
    Posted 15/02/2009 at 17:17 | Permalink

    เอาไว้ในโฟลเดอร์เดียวกับโฟลเดอร์ที่เราเก็บสคริปต์ ของเรา

    ดูคำสั่งนี้นะครับ require_once ‘Zend/Loader.php’; แสดงว่า โฟลเดอร์ Zend อยู่ในระดับเดียวกับไฟล์โค้ด ของเรา

  3. Phet Firefox 3.0.6 Windows XP
    Posted 15/02/2009 at 22:46 | Permalink

    ขอบคุณมากครับ ได้แล้วครับ

    ขอรบกวนอีกนิดนึงนะครับ คือว่า ผมทดสอบบนเครื่องตัวเอง (localhost) ก็ใช้การได้ ทีนี้ผม upload script ทั้งสองตัว และ folder Zend ไปยัง Free host ที่ USA

    ผมลอง PHPINFO() ดู พบว่า openssl enabled ครับ ก็ลองใช้ดู พอสั่งรัน script ก็ได้รับ Event ใน Calendar ผม แต่ผมไม่ได้รับ meesage เข้าโทรศัพท์ครับ แบบนี้จะแก้ไขยังไงครับ

    ขอบคุณมากครับ

  4. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.0.6 Windows XP
    Posted 16/02/2009 at 08:54 | Permalink

    คือหมายถึงว่า คุณได้ตั้งค่าให้ google calendar ส่ง SMS หาคุณได้แล้ว ใช่มั้ยครับ

    คงต้องลองตรวจการตั้งค่าของกูเกิล อีกทีครับ ทดสอบโดยการสร้างรายการใหม่เอง ใน google calendar เลย แล้วลองตั้งเวลาให้มันส่ง SMS ดูว่าใช้ได้หรือยัง

    จริงๆ ถ้าโค้ดโอเคแล้ว ปัญหาน่าจะอยู่ที่การตั้งค่าใน google calendar

    ได้หรือไม่ได้ยังไง บอกด้วยนะครับ ยินดีช่วยครับผม

  5. Phet Firefox 3.0.6 Windows XP
    Posted 16/02/2009 at 09:55 | Permalink

    ใช่ครับ เพราะตอนผมลองใน localhost ผมได้รับ message แต่พอให้ โฮสที่ USA ส่ง ได้รับ event แต่ไม่ได้รับ message ครับ

    ขอบคุณมากครับ

  6. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.0.6 Windows XP
    Posted 16/02/2009 at 10:04 | Permalink

    น่าจะเป็นเพราะความแตกต่างของเวลา ลองรันโค้ดดู แล้วดูรายการว่ามัน เริ่มเวลาที่เท่าไร จบที่เท่าไหร่ ใน google calendar นะครับ

  7. Phet Firefox 3.0.6 Windows XP
    Posted 16/02/2009 at 11:26 | Permalink

    ครับ ผมลองรันใหม่แล้วครับ ปรากฎว่า เวลาที่ event มาถึง เป็นเวลา GMT ซึ่งผมคิดว่า โฮสนั้นน่าจะใช้เวลาเป็น GMT ผมเลยลองเข้าไปดู code ด้านล่างครับ

    // Set the date using RFC 3339 format.
    $startDate = date( “Y-m-d” );//”2009-01-15″;
    $startTime = date( “H:i” , strtotime(“+3 minutes”) );
    $endDate = date( “Y-m-d” );
    $endTime = date( “H:i” , strtotime(“+6 minutes”) );
    $tzOffset = “+07″;

    $when = $service->newWhen();
    $when->startTime = “{$startDate}T{$startTime}:00.000{$tzOffset}:00″;
    $when->endTime = “{$endDate}T{$endTime}:00.000{$tzOffset}:00″;

    ผมก็เลยคิดว่า มันมาช้าไป 7 ชม ก็เลยแก้ $tzOffset = “+07″; เป็น +14 ทีนี้ไม่ได้รับ event เลยครับ เลยลองแก้เป็น “00″ ได้รับ message แล้วครับ (ยัง งงๆ อยู่)

    อีกนิดนะครับ (‘_’!) ผมเห็นว่า code ส่วน

    $reminder = $service->newReminder();
    $reminder->method = “sms”;
    $reminder->minutes = “2″;

    ตรง $reminder->method นี้ครับ เราสามารถทำให้ส่ง email ไปหา account อื่นๆ ได้ไหมครับ เช่น hotmail ฯลฯ

    ขอบคุณมากนะครับสำหรับคำแนะนำ

  8. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.0.6 Windows XP
    Posted 16/02/2009 at 11:34 | Permalink

    $tzOffset = “+07″; โค้ดตรงนี้ไว้สำหรับเซต offset ของเวลา โฮสต์ผมอยู่ในไทย เลยต้อง +7 เข้าไป ลืมนึกไปถึงว่าอาจจะมีคนที่ใช้โฮสต์ของต่างประเทศ เลยไม่ได้แนะนำไว้

    “ตรง $reminder->method นี้ครับ เราสามารถทำให้ส่ง email ไปหา account อื่นๆ ได้ไหมครับ เช่น hotmail ฯลฯ”

    เราสามารถตั้งให้ส่งเป็น อีเมล์ได้ครับ แต่จะส่งเข้าได้เฉพาะอีเมล์ gmail ของเราเท่านั้นครับ
    $reminder->method = “email”;

  9. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.0.6 Windows XP
    Posted 16/02/2009 at 11:45 | Permalink

    ขออธิบายเรื่อง offset ของเวลานิดนึงนะครับ ท่านเคยสังเกตเวลาเราติดตั้งวินโดวมั้ยครับ เวลาให้เราเลือกโซนของเวลา ของเราจะเลือกเป็น GMT+7 bangkok/hanoi/jakata ที่ต้องเป็น +7 เพราะเนื่องจากว่า เวลาบ้านเราจะเร็วกว่า เวลา ณ เส้นกรีนนิช หรือเส้น 0 นาฬิกา อยู่ 7 ชั่วโมง

    ประเทศอื่นๆ ก็เหมือนกันจะมีเวลา ที่เร็วช้าต่างกัน ถ้าอยากทราบว่าประเทศไหน เร็วช้า ต่างกันอยู่เท่าไร ก็ดูได้จาก reginal and language settings ในวินโดว

    เวลาเรา get เวลาจากโฮสต์ มันก็จะได้เวลาตาม ประเทศที่โฮสต์ ตั้งอยู่ ซึ่งในบางครั้งมันจะไม่ใช่เวลาที่เราต้องการ ต้องเอามา + มา – กันเล็กน้อย

    $tzOffset = “+07″; เป็นความหมายบอกไปยังกูเกิลกลายๆว่า โฮสต์ผมอยู่โซนเมืองไทยนะ เวลาที่ให้ไป ก็เป็นเวลาของเมืองไทยนะ

    หลังจากนั้นกูเกิลเขาจะแปลงเวลาให้เป็นอย่างที่เขาต้องการอีกที

  10. Anonymous Firefox 3.0.6fdnet Windows XP
    Posted 18/02/2009 at 16:14 | Permalink

    ติดตั้งแล้วลองเปิดจากโค้ดที่ให้มา เจอปัญหานี้ จะต้องแก้อย่างไรดีครับ
    Fatal error: Call to undefined function ctype_alnum() in /home/myweb/Zend/Uri.php on line 107

  11. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.0.6 Windows XP
    Posted 18/02/2009 at 16:29 | Permalink

    คุณลองใช้คำสั่ง phpinfo() ตรวจดูว่าได้เปิด OpenSSL ไว้หรือเปล่าครับ

  12. Anonymous Firefox 3.0.6fdnet Windows XP
    Posted 19/02/2009 at 00:00 | Permalink

    ขอบคุณครับ เหมือนจะปิดไว้จริงๆ ต้องไปเซ็ทเปิดที่ไหนเหรอครับ

  13. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.0.6 Windows XP
    Posted 19/02/2009 at 08:27 | Permalink

    ต้องไปแก้ที่ไฟล์ php.ini ครับ ถ้าใช้วินโดวส์ คุณก็เปิด Run ขึ้นมาแล้ว พิมพ์ php.ini เข้าไป มันจะเปิดขึ้นมาเองครับ เพราะไฟล์นี้เก็บไว้ที่ โฟลเดอร์ System32 ของระบบ

  14. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.0.6 Windows XP
    Posted 19/02/2009 at 08:31 | Permalink

    ขอโทษทีเมื่อกี้อธิบายไม่ละเอียด

    หลังจากเปิดไฟล์ php.ini ขึ้นมาแล้ว หาบรรทัดนี้ ;extension=php_openssl.dll ลบเครื่องหมาย ; (คอมม่า) ด้านหน้าออก Save แล้วก็รีสตาร์ท Apache ครับ

  15. Anonymous Firefox 3.0.6fdnet Windows XP
    Posted 19/02/2009 at 14:23 | Permalink

    ได้แล้ว ขอบคุณครับ :)

  16. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.0.6 Windows XP
    Posted 19/02/2009 at 14:31 | Permalink

    ด้วยความยินดีครับ

  17. pex Firefox 3.0.6 Windows XP
    Posted 24/02/2009 at 11:35 | Permalink

    มันเป็นภาษาต่างดาวครับ ต้องแก้ที่ไหนครับ แล้ว Message ที่ส่งมันสั้นมากครับ
    จะตัดวันที่ทิ้งยังไงครับ

  18. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.0.6 Windows XP
    Posted 24/02/2009 at 12:03 | Permalink

    มันเป็นภาษาต่างดาว เพราะคุณใช้ encoding แบบ TIS-620/Windows-874 ซึ่งตัว Zend มันเป็น UTF-8

    ส่วนเรื่องข้อความสั้นนั้น ที่จริงแล้ว ไม่สั้นครับ ได้อย่างน้อยๆ ก็ 15 คำขึ้น แต่ของคุณมันสั้น เพราะตัวหนังสือมันเป็นต่างดาว วันที่เราตัดทิ้งไม่ได้ครับ เพราะมันอยู่ที่กูเกิล ว่าจะแนบอะไรต่อท้ายข้อความมาให้เราด้วย

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

  19. pex Firefox 3.0.6 Windows XP
    Posted 24/02/2009 at 17:06 | Permalink

    Encode เป็น UTF-8 แก้ที่ไหนครับ

  20. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.0.6 Windows XP
    Posted 24/02/2009 at 21:14 | Permalink

    ลองใส่คำสั่ง

    <?php
    header ('Content-type: text/html; charset=utf-8');
    ?>

    ไว้บรรทัดแรกสุดของโค้ดคุณ นะครับ

  21. pex Firefox 3.0.6 Windows XP
    Posted 25/02/2009 at 08:48 | Permalink

    ไม่ได้เหมือนกันครับ ผมลองพิมพ์ภาษาไทยเทสบนหน้าเว็บเพจมันเป็นต่างดาวครับ แต่ถ้า Encode เป็น Tis620 จะโชว์ได้ครับ

  22. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.0.6 Windows XP
    Posted 25/02/2009 at 08:57 | Permalink

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

  23. pex Firefox 3.0.6 Windows XP
    Posted 25/02/2009 at 09:11 | Permalink

    พิมพ์โดยตรงได้ครับ ไม่มีปัญหาอะไร

  24. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.0.6 Windows XP
    Posted 25/02/2009 at 09:17 | Permalink

    งั้นเปลี่ยนคำสั่งนี้ใหม่

    <?php
    header ('Content-type: text/html; charset=tis620');
    ?>

    ไว้บรรทัดบนสุดเหมือนเดิม

  25. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.0.6 Windows XP
    Posted 25/02/2009 at 09:20 | Permalink

    ผมพอจะเริ่มเข้าใจปัญหาแล้ว ปัญหามันเกิดเนื่องจาก ไฟล์ ของ zend framework มันเป็น utf-8 แต่ไฟล์ของคุณเป็น tis-620 ทีนี้พอ include ตัว zend framework เข้ามา มันพลอยเปลี่ยน เพจของคุณให้ไปเป็น utf-8 ด้วย ทำให้พอพิมพ์ภาษาไทย เลยเป็น ยิกยุก ฉะนั้น ก็ต้องบังคับให้ output ออกมาเป็น tis-620

  26. pex Firefox 3.0.6 Windows XP
    Posted 25/02/2009 at 09:39 | Permalink

    แล้วต้องแก้ยังไงครับ ผมลอง

    แล้วก็ไม่ได้เหมือนกันครับ

    • วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.0.6 Windows XP
      Posted 25/02/2009 at 09:46 | Permalink

      พอจะส่ง url ที่คุณทดสอบไฟล์ ให้ผมหน่อยได้มั้ย อยากเห็นว่าเกิดอะไรขึ้น

  27. pex Firefox 3.0.6 Windows XP
    Posted 25/02/2009 at 09:53 | Permalink

    ผมใช้เป็น localhost ครับ

  28. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.0.6 Windows XP
    Posted 25/02/2009 at 09:54 | Permalink

    ผมผิดเอง รู้สึกว่า tis620 มันจะต้องมีขีดคั่นระหว่างกลางด้วยตัวนึง tis-620

    <?php
    header('Content-Type: text/html; charset=tis-620');
    ?>
  29. pex Firefox 3.0.6 Windows XP
    Posted 25/02/2009 at 10:21 | Permalink

    ไม่ได้เหมือนกัน ผมทำอะไรผิดเนี่ย

  30. pex Firefox 3.0.6 Windows XP
    Posted 25/02/2009 at 11:08 | Permalink

    ได้แล้ววว ขอบคุณอีกทีครับ

  31. papra Firefox 3.0.7.NETCLR3.5.30729 Windows XP
    Posted 22/03/2009 at 05:26 | Permalink

    ผมทำได้หมดแล้ว ครับ แต่ คิด ที่ไม่ยอม sms มาสักที รอ 2 ชั่วโมงก็ไม่ ส่ง ดู ปฏิทิน มันก็ ขึ้นนะครับว่า เราสงข้อความไป แต่มันกลับไม่สง sms มา ช่วยบอกผมหน่อยครับ ว่ามัน เพราะอะไรหรอ ขอบคุณ ครับ

    • วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator MSIE 8.0 Windows XP
      Posted 22/03/2009 at 16:13 | Permalink

      ลองอย่างงี้ครับ ให้ไปเพิ่มรายการใน google calendar แล้วตั้งให้มันส่ง SMS แล้วรอดูว่ามันส่งหรือเปล่า อันนี้เพื่อทดสอบว่าบริการของกูเกิล ยังปกติ

      ทีนี้ ลองดูในรายการที่เราตั้งเวลาให้ส่ง SMS ดูว่าเวลาตรงกับที่เราตั้งใจให้เป็นหรือเปล่า ถ้ามันผิดเพี้ยน แสดงว่าเกิดขึ้นเพราะเรื่องของโซนเวลา ดูในฟังก์ชั่นที่ผมเขียนไว้นะ มันจะมีกำหนดโซนเวลาด้วย

  32. wachira Firefox 3.0.8 Windows XP
    Posted 04/05/2009 at 02:18 | Permalink

    เจอ error แบบนี้ครับ

    Warning: domdocument::domdocument() expects parameter 2 to be long, string given in C:\AppServ\www\test\Zend\Gdata\App\Base.php on line 201

    Fatal error: Call to undefined method domdocument::createElementNS() in C:\AppServ\www\test\Zend\Gdata\App\Base.php on line 211

    ลองหาใน google เขาให้เปิดใช้ domxml.dll ก็ไมได้ครับ

    • p_น้อง Firefox 8.0 Windows XP
      Posted 15/12/2011 at 14:07 | Permalink

      ที่ web server ต้องลง DOMXML ด้วยครับ

      ผม ก็เจอ เหมือนกัน แต่ ของผม เป็น web server ตัวเอง ผมเลย สั่ง yum install php-xml

  33. lltumll Firefox 3.0.10 Windows XP
    Posted 31/05/2009 at 05:29 | Permalink

    ก่อนอื่นขอบคุณสำหรับบทความดีๆนะครับ

    ของผมส่งได้นะครับ แต่ หัวข้อกับเนื้อหาไม่มีนะครับ งง ครับ<<< ควรทำไงครับ

  34. lltumll Firefox 3.0.10 Windows XP
    Posted 31/05/2009 at 05:37 | Permalink

    ภาษาอังกฤษได้ครับเดี่ยวลองส่งภาษาไทย ดูอีกครั้ง^_^

  35. lltumll Firefox 3.0.10 Windows XP
    Posted 31/05/2009 at 21:21 | Permalink

    ได้ทั้งสองภาษาแล้วครับ

    • Posted 29/11/2011 at 11:28 | Permalink

      ส่งได้ทั้งสองภาษาแล้เวหรอ คะ ขอคำแนะนำหนอ่ยะคะ

  36. bootman MSIE 8.0 Windows XP
    Posted 18/06/2009 at 10:18 | Permalink

    ดูให้หน่อยครับของผมมันขึ้น error

    Fatal error: Uncaught exception ‘Zend_Gdata_App_HttpException’ with message ‘Unable to Connect to ssl://www.google.com:443. Error #44262864: Unable to find the socket transport “ssl” – did you forget to enable it when you configured PHP?’ in C:\AppServ\www\google_sms\Zend\Gdata\ClientLogin.php:140 Stack trace: #0 C:\AppServ\www\google_sms\send.php(48): Zend_Gdata_ClientLogin::getHttpClient(‘artsukda’, ’471794159′, ‘cl’) #1 C:\AppServ\www\google_sms\send.php(102): send_sms(‘artsukda’, ’471794159′, ‘???????????????…’, ‘???????????????…’) #2 {main} thrown in C:\AppServ\www\google_sms\Zend\Gdata\ClientLogin.php on line 140

  37. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator MSIE 6.0 Windows XP
    Posted 18/06/2009 at 10:29 | Permalink

    คุณไม่ได้เปิดการใช้งาน ssl ใน php.ini ครับ

  38. bootman MSIE 8.0 Windows XP
    Posted 18/06/2009 at 10:37 | Permalink

    ผมเปิดแล้วน่ะครับผม ตรง php.ini extension=php_openssl.dll ลบ ; ออกใช่หมัยครับ

  39. bootman MSIE 8.0 Windows XP
    Posted 18/06/2009 at 10:40 | Permalink

    file script ผมก๊อปไปแล้ว ตั้งชื่อ เป็น send.php เอาไว้นอกโฟลเดอร์ Zend ได้ป่าวครับ

  40. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator MSIE 6.0 Windows XP
    Posted 18/06/2009 at 11:02 | Permalink

    extension=php_openssl.dll ลบ ; ถูกต้องครับ

    ‘file script ผมก๊อปไปแล้ว ตั้งชื่อ เป็น send.php เอาไว้นอกโฟลเดอร์ Zend ได้ป่าวครับ’ ใช่ครับต้องอยู่นอกโฟลเดอร์ Zend

  41. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator MSIE 6.0 Windows XP
    Posted 18/06/2009 at 11:05 | Permalink

    เพิ่มเติมๆ คุณต้องไปดูด้วยว่าในโฟลเดอร์ C:\AppServ\php5\extras มี openssl อยู่หรือเปล่า

  42. bootman MSIE 8.0 Windows XP
    Posted 18/06/2009 at 11:07 | Permalink

    แล้วผมต้องไปแก้ตรงหนัยอีกป่าวครับ ทำมัยมัน error ครับผม

  43. bootman MSIE 8.0 Windows XP
    Posted 18/06/2009 at 11:08 | Permalink

    ครับผม

  44. bootman MSIE 8.0 Windows XP
    Posted 18/06/2009 at 11:09 | Permalink

    มีครับผม

  45. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator MSIE 6.0 Windows XP
    Posted 18/06/2009 at 11:37 | Permalink

    มันเป็นปัญหาเรื่องการเปิดใช้งาน ssl นั่นแหละครับ เดี๋ยวผมจะหารายละเอียดให้อีกที หรือถ้าต้องการด่วน ลองเข้าไปถามที่ http://www.appservnetwork.com ดู เขาเป็นคนทำ appserv

  46. bootman MSIE 8.0 Windows XP
    Posted 18/06/2009 at 11:37 | Permalink

    ครับผมขอบคุณมากครับผม

  47. bootman MSIE 8.0 Windows XP
    Posted 18/06/2009 at 14:29 | Permalink

    ไม่ได้เลยครับพี่แต่ก็ไม่เป็นรัยขอบคุณมากครับพี่

  48. Anonymous MSIE 6.0 Windows XP
    Posted 25/08/2009 at 14:39 | Permalink

    มี Error ตามนี้อ่ะครับ
    Fatal error: Uncaught exception ‘Zend_Gdata_App_HttpException’ with message ‘Unable to Connect to ssl://www.google.com:443. Error #55635344: Unable to find the socket transport “ssl” – did you forget to enable it when you configured PHP?’ in C:\AppServ\www\Test_Zend_SMS\library\Zend\Gdata\ClientLogin.php:140 Stack trace: #0 C:\AppServ\www\Test_Zend_SMS\library\send.php(40): Zend_Gdata_ClientLogin::getHttpClient(‘scada.josh@gmai…’, ‘anusornkrongkan’, ‘cl’) #1 C:\AppServ\www\Test_Zend_SMS\library\send.php(94): send_sms(‘scada.josh@gmai…’, ‘anusornkrongkan’, ‘???????????????…’, ‘???????????????…’) #2 {main} thrown in C:\AppServ\www\Test_Zend_SMS\library\Zend\Gdata\ClientLogin.php on line 140

    • วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Chrome 4.0.202.0 Windows XP
      Posted 25/08/2009 at 14:47 | Permalink

      คุณต้องเปิดการใช้งาน ssl ด้วยครับ ถ้าไม่อยากแก้ไรมาก็เอาไปทดสอบบนโฮสต์ แต่ถ้าต้องการทดสอบในเครื่อง ลองหาวิธีเปิดใช้งาน ssl ใน กูเกิลดูครับ

  49. ิbootman Firefox 3.5.2.NETCLR3.5.30729 Windows XP
    Posted 26/08/2009 at 07:52 | Permalink

    ขอบคุณมากครับผม

  50. Anonymous MSIE 6.0 Windows XP
    Posted 26/08/2009 at 09:32 | Permalink

    มันส่งไปให้ google calendar เป็นแบบนี้อ่ะครับ
    ����ͧ����ͧ����

    ทำไงดีครับ
    อีกอย่างคือ มีการสร้าง event calendar แต่มันไม่ส่ง SMS

    …ถ้าเราเซตที่ google calendar แบบ manual ส่งได้ปกติครับ

    ช่วยด้วยครับ

    • วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Chrome 4.0.202.0 Windows XP
      Posted 26/08/2009 at 09:46 | Permalink

      มันเ็ป็นเพราะ utf-8 และเป็นเรื่องความต่างของเวลา อ่านคอมเม้นท์ด้านบนนะครับ เขาเคยเจอปัญหานี้ และผมได้เสนอวิธีแก้ไปแล้ว

  51. Anonymous MSIE 6.0 Windows XP
    Posted 26/08/2009 at 10:36 | Permalink

    Coding เป็นไปตามนี้ ครับ

    newEventEntry();
     
    // Populate the event with the desired information
    // Note that each attribute is crated as an instance of a matching class
    $event->title = $service->newTitle( $param_title );
     
    //$event->where = array($service->newWhere(“Mountain View, California”));
    $event->content = $service->newContent( $param_content );
     
    // Set the date using RFC 3339 format.
    $startDate = date( “Y-m-d” );//”2009-01-15″;
    $startTime = date( “H:i” , strtotime(+3 minutes”) );
    $endDate = date( “Y-m-d” );
    $endTime = date( “H:i” , strtotime(+6 minutes”) );
    $tzOffset =+08;
     
    $when = $service->newWhen();
    $when->startTime ={$startDate}T{$startTime}:00.000{$tzOffset}:00;
    $when->endTime ={$endDate}T{$endTime}:00.000{$tzOffset}:00;
     
    // Create a new reminder object. It should be set to send an email
    // to the user 10 minutes beforehand.
    $reminder = $service->newReminder();
    $reminder->method = “sms”;
    $reminder->minutes =2;
     
    $when->reminders = array($reminder);
     
    $event->when = array($when);
     
    // Upload the event to the calendar server
    // A copy of the event as it is recorded on the server is returned
    if ($newEvent = $service->insertEvent($event)){
     
    return true ;
    }else{
     
    return false;
    }
     
    }?>

    แต่ก็ยังส่งไทยไม่ได้ครับผม
    งงครับ ไม่แน่ใจผิดตรงไหนหรือเปล่าครับ

  52. Anonymous MSIE 6.0 Windows XP
    Posted 26/08/2009 at 10:41 | Permalink

    ขอโทษทีครับ
    พอดีข้อความเยอะไปหน่อย ผมแค่อยากจะบอกว่า ผมใส่

    ไปในส่วนบนสุดของไฟล์แล้วครับผม
    แต่ยังไม่ได้

    ยังไงต้องขอบคุณมากนะครับ ทำให้ผมเปิดโลกทัศน์
    และสนุกกับการทำโปรแกรมครับ
    เพิ่งรู้ครับ ว่าสามารถส่ง SMS ฟรี!! ได้ด้วย
    เจ๋งจิงครับพี่

  53. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Chrome 4.0.202.0 Windows XP
    Posted 26/08/2009 at 11:57 | Permalink

    อ่านบทความนี้ของผมครับ http://www.select2web.com/general/using-utf-8-final.html ว่าด้วยเรื่องการใช้งาน utf-8 กูเกิล calendar มันไม่ยอมรับ encoding แบบอื่น

    เมื่อเข้าไปในลิ้งก์นี้แล้ว ให้ดูที่ผมแนะนำไว้ ข้อ 5 และ 6

  54. SCADA.Josh MSIE 6.0 Windows XP
    Posted 26/08/2009 at 16:44 | Permalink

    เจ๋งสุดๆ ครับ
    ได้แล้วครับ

    เมื่อวานลองลองทดสอบดู ปรากฏว่าทดสอบไม่ผ่าน เนื่องจากหลายสาเหตุ ครับ
    - ไม่เปิดใช้งาน SSL
    - ไม่ได้ กำหนด include_path ใน php.ini
    - ติด Proxy บริษัท
    - PHP เวอร์ชันต่ำกว่า 5.1.4
    - ติดเรื่องส่งภาษาไทย

    ปัจจุบันเคลีร์ยครับ ขอบคุณมากครับผม
    ผมเริ่มสนใจ การทำ Application กับ Google แล้วล่ะครับ

  55. Posted 27/08/2009 at 22:15 | Permalink

    อุ้ย! เห็นหัวข้อแล้วผมตกใจเลย ไม่คิดว่า จะมีบทความที่เราจะสามารถทำเรื่องแบบนี้ได้เอง ขอบคุณก่อนเลยครับ แล้วรีบทำตามทันที ขอบคุณมากๆๆๆๆๆ เลยครับ

  56. Posted 27/08/2009 at 22:19 | Permalink

    ผมทำตามขั้นตอน
    เอามาเพิ่มเติมให้ครับ

    วิธีเปิดใช้งาน ssl
    http://adsense.google.com/support/bin/answer.py?hl=th&answer=35730

  57. TIK MSIE 6.0 Windows XP
    Posted 14/09/2009 at 14:38 | Permalink

    อยากพิมพ์ข้อความยาว ๆ แต่พิมพ์ไม่ได้

  58. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.5.3.NETCLR3.5.30729 Windows XP
    Posted 14/09/2009 at 15:29 | Permalink

    - อยากพิมพ์ข้อความยาว ๆ แต่พิมพ์ไม่ได้ – ความยาวเป็นข้อกำหนดของทาง google เขาครับ

    วิธีที่พอจะทำได้คือ แบ่งข้อความของเราออกเป็นชุดย่อยๆ แล้วส่ง

  59. Puwanart MSIE 6.0 Windows XP
    Posted 18/09/2009 at 09:13 | Permalink

    สวัสดีครับ รบกวนนิดหนึ่งนะครับ เครื่องผมใช้ IIS ปรับแต่งให้รัน PHP ได้ และทำตามวิธีที่คุณ Platoosom แนะนำแล้วยังมีปัญหาครับ รบกวนด้วยนะครับ ขอบคุณครับ

    Fatal error: Uncaught exception ‘Zend_Gdata_App_HttpException’ with message ‘Unable to read response, or response is empty’ in D:wwwsmsZendGdataClientLogin.php:140 Stack trace: #0 D:wwwsmsindex.php(42): Zend_Gdata_ClientLogin::getHttpClient(‘myaccount’, ‘mypassword’, ‘cl’) #1 D:wwwsmsindex.php(96): send_sms(‘myaccount’, ‘mypassword’, ‘send sms from m…’, ‘I send sms from…’) #2 {main} thrown in D:wwwsmsZendGdataClientLogin.php on line 140

  60. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.5.3.NETCLR3.5.30729 Windows XP
    Posted 18/09/2009 at 09:34 | Permalink

    ได้ใส่ username กับ password หรือยัง

  61. Puwanart MSIE 6.0 Windows XP
    Posted 18/09/2009 at 09:50 | Permalink

    ใส่แล้วครับ ผมสังเกตว่า ถ้าผมไม่เข้าหน้า google (gmail) แล้ว Login ค้างไว้ โปรแกรมไม่สามารถทำงานได้และจะฟ้อง error แบบที่ผมแจ้งน่ะครับ …ใช่หรือเปล่าครับ?

    คือผมไม่แน่ใจนะครับ มันไม่น่าจะเกี่ยวนะครับ ผมรบกวนคุณ Platoosom ช่วยแนะนำหน่อยสิครับ

    • วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.5.3.NETCLR3.5.30729 Windows XP
      Posted 18/09/2009 at 10:01 | Permalink

      ไม่นะครับ ปกติไม่จำเป็นจะต้องล้อกอินค้างไว้ใดๆ ผมไม่แน่ใจว่าจะเกี่ยวกับ IIS หรือเปล่านะครับ ถ้ามีโฮสต์เป็นของตัวเอง ลองเอาไปรันบนโฮสต์ดูครับ

  62. Posted 22/10/2009 at 14:55 | Permalink

    ขอบคุณมากครับ เป็นประโยชน์มากๆ ลองใช้แล้วเจ๋งจริงๆ

  63. chilup Firefox 3.5.3 Windows XP
    Posted 23/10/2009 at 12:00 | Permalink

    คำถามที่ 1 มันสามารถส่งข้อความให้หลายๆ คน พร้อมกันได้ไหมอ่ะครับ

    คำถามที่ 2 มันส่งติดต่อกันไม่ได้หรอครับ ผมส่งติดต่อกันเกิน 5 ฉบับ ส่งต่อไม่ได้แล้วครับ

    ึคำถามที่ 3 ไม่มีค่าใช้จ่ายอะไรเลยใช่ไหมครับ

  64. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.5.3.NETCLR3.5.30729 Windows XP
    Posted 24/10/2009 at 09:35 | Permalink

    คำตอบที่ 1 ส่งไม่ได้ครับ ถ้าจะส่งต้องลูปส่งไปทีละคน

    คำตอบที่ 2 ส่งติดต่อกันมากไม่ได้นะครับ เพราะว่าต้องเข้าใจว่ากูเกิลมันก็กลัวแสปมเป็น

    คำตอบที่ 3 ไม่มีล้านเปอร์เซ็นต์ครับ สำหรับข้อความที่ออกมาจากกูเกิล ถ้าจะมีก็เฉพาะตอนท่านเปิด SMS ผมไม่แน่ใจว่าเดี๋ยวนี้เขายังเก็บกันอยู่หรือเปล่านะ TRUE DTAC ไม่เก็บ AIS ผมไม่แน่ใจเพราะว่ายังไม่ได้ทดสอบ ถ้าเป็นเมื่อก่อนสองปีที่แล้ว AIS เวลาเปิด SMS จะเสียตังส์

    กูเกิลรวย

  65. mandmod Maxthon 2.0 Windows XP
    Posted 29/10/2009 at 16:01 | Permalink

    ขอบคุณครับ กับสิ่งดีๆ ที่คุณให้ ขอยืมคำพูดที่เจอมา

    คำขอบคุณสักพันครั้ง ไม่เท่ากับการแบ่งปันแค่ครั้งเดียว

  66. KU Firefox 3.5.7 Windows XP
    Posted 21/01/2010 at 15:20 | Permalink

    ขอทราบวิธีติดตั้ง เจ้าzendหน่อยคับ
    ผมโหลดโพเดอร์ zend ขึ้นโฮส เเล้ว
    ทํางัยต่อ คับ เห็นมีหลายไฟล์ ไม่รู้จะใช้ยังไง
    งงมากเลยอ่าคับ

  67. KU Firefox 3.5.7 Windows XP
    Posted 21/01/2010 at 15:38 | Permalink

    ถ้าเว็บเรามีพีเอชพี contact form ที่ส่งเข้าอีเมล์เรา
    แล้วอยากใ้ห้มันส่ง sms แจ้งเตือนไปมือถือเราด้วย
    เมื่อเวลามีคนส่งอะไรมา จะต้องทํางัยคับ งงมากมาย

  68. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Chrome 4.0.295.0 Windows XP
    Posted 21/01/2010 at 15:46 | Permalink

    ตอบคุณ KU ไม่ต้องไปสนใจครับว่าในโฟลเดอร์ Zend มีอะไรบ้าง

    ให้เอาไว้ในโฟลเดอร์เดียวกับโฟลเดอร์ที่เราเก็บสคริปต์ ของเรา

    ดูคำสั่งนี้นะครับ require_once ‘Zend/Loader.php’; แสดงว่า โฟลเดอร์ Zend อยู่ในระดับเดียวกับไฟล์โค้ด ของเรา

    ส่วนที่ถามว่ามีคอนแท็กฟอร์มอยู่แล้วต้องการเพิ่มให้มันส่ง SMS ก็เอาโค้ด ส่ง SMS ไปเพิ่มเข้าในไฟล์เดิม

     

  69. KU Firefox 3.5.7 Windows XP
    Posted 21/01/2010 at 19:12 | Permalink

    โอ้วย..ขอบคุงมั้กๆ คับ คุงplatoosom
    สุดยอดจิงๆ สําเร็จเเล้ว ขอถามเพิ่มเติมนะครับ
    1. เวลาใช้ คือต้อง เปิดไฟล์ send_sms.php ในบาวร์เซอร์ กดenter ใช่มัยคับ
    2.  sms มันไม่ส่งตัว content มาด้วย มาเเต่ title อ่าคับ
    3. ผมอยากใ้ห้ contact form มันเเจ้ง sms แต่ไม่ทราบวิธี สคริปผมเป็นเเบบนี้
    คับ ไม่ทราบต้องนําไฟล์ send_sms.php ไม่เเทรกตรงบรรทัดไหนคับ

    <?php
    if(isset($_POST['submit'])) {
    $to =555@hotmail.com”;
    $subject = “Form Tutorial”;
    $name_field = $_POST['name'];
    $email_field = $_POST['email'];
    $message = $_POST['message'];
    $option = $_POST['radio'];
    $dropdown = $_POST['drop_down'];
     
    foreach($_POST['check'] as $value) {
    $check_msg .= “Checked: $value\n”;
    }
     
    $body = “From: $name_field\n E-Mail: $email_field\n $check_msg Option: $option\n Drop-Down: $dropdown\n Message:\n $message\n”;
     
    echo “Data has been submitted to $to!;
    mail($to, $subject, $body);
     
    } else {
    echo “blarg!;
    }
    ?>
  70. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Chrome 4.0.249.64 Windows XP
    Posted 21/01/2010 at 19:52 | Permalink

    ตอบ 1. เราก็ต้องประยุกต์นำไปประกอบฟอร์มครับ ให้ยูสเซ่อร์ป้อนคำที่ต้องการส่ง แล้วเราก็ส่ง SMS เข้าโทรศัพท์

    ตอบ 2. ถูกต้องแล้วมันจะส่งแต่ไตเติลครับ ส่วนคอนเท้นท์นั้นเราใส่ไปเฉยๆ เพื่อให้รายการมันสมบูรณ์ ไม่งั้นเดี๋ยวกูเกิลมันจะไม่ส่ง SMS ให้เรา

    ตอบ 3.

    <?php
    function send_sms( $param_google_username , $param_google_password,$param_title,$param_content ){
     
    	/**
    	 * @Include Zend_Loader
    	 */
    	require_once 'Zend/Loader.php';
     
    	/**
    	 * @Load Zend_Gdata
    	 */
    	Zend_Loader::loadClass('Zend_Gdata');
     
    	/**
    	 * @Load Zend_Gdata_AuthSub
    	 */
    	Zend_Loader::loadClass('Zend_Gdata_AuthSub');
     
    	/**
    	 * @Load Zend_Gdata_ClientLogin
    	 */
    	Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
     
    	/**
    	 * @Load Zend_Gdata_HttpClient
    	 */
    	Zend_Loader::loadClass('Zend_Gdata_HttpClient');
     
    	/**
    	 * @Load Zend_Gdata_Calendar
    	 */
    	Zend_Loader::loadClass('Zend_Gdata_Calendar');
     
    	// Parameters for ClientAuth authentication
    	$service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
    	$user = $param_google_username ;
    	$pass =$param_google_password ;
     
    	// Create an authenticated HTTP client
    	$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);
     
    	// Create an instance of the Calendar service
    	$service = new Zend_Gdata_Calendar($client);
     
    	// Create a new entry using the calendar service's magic factory method
    	$event= $service->newEventEntry();
     
    	// Populate the event with the desired information
    	// Note that each attribute is crated as an instance of a matching class
    	$event->title = $service->newTitle( $param_title );
     
    	//$event->where = array($service->newWhere("Mountain View, California"));
    	$event->content = $service->newContent( $param_content );
     
    	// Set the date using RFC 3339 format.
    	$startDate = date( "Y-m-d" );//"2009-01-15";
    	$startTime = date( "H:i" , strtotime("+3 minutes") );
    	$endDate = date( "Y-m-d" );
    	$endTime = date( "H:i" , strtotime("+6 minutes") );
    	$tzOffset = "+07";
     
    	$when = $service->newWhen();
    	$when->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00";
    	$when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
     
    	// Create a new reminder object. It should be set to send an email
    	// to the user 10 minutes beforehand.
    	$reminder = $service->newReminder();
    	$reminder->method = "sms";
    	$reminder->minutes = "2";
     
    	$when->reminders = array($reminder);
     
    	$event->when = array($when);
     
    	// Upload the event to the calendar server
    	// A copy of the event as it is recorded on the server is returned
    	if ($newEvent = $service->insertEvent($event)){
     
    		return true ;
    	}else{
     
    		return false;
    	}
     
    } 
    ?>
    <?php
    if(isset($_POST['submit'])) {
    $to =555@hotmail.com”;
    $subject = “Form Tutorial”;
    $name_field = $_POST['name'];
    $email_field = $_POST['email'];
    $message = $_POST['message'];
    $option = $_POST['radio'];
    $dropdown = $_POST['drop_down'];
     
    foreach($_POST['check'] as $value) {
    $check_msg .= “Checked: $value\n”;
    }
     
    $body = “From: $name_field\n E-Mail: $email_field\n $check_msg Option: $option\n Drop-Down: $dropdown\n Message:\n $message\n”;
     
    echo “Data has been submitted to $to!;
    mail($to, $subject, $body);
     
     
     
    $google_username = "xxxxxxxxxxx"; // username เข้ากูเกิลของคุณ
    $google_password = "xxxxxxxxxxx"; // password เข้ากูเกิลของคุณ
     
    // ส่ง SMS
    send_sms( $google_username , $google_password , $subject ,$body );
     
     
     
     
    } else {
    echo “blarg!;
    }
    ?>
  71. KU Firefox 3.5.7 Windows XP
    Posted 21/01/2010 at 22:13 | Permalink

    มันเอ่อเร่ออ่าคับ
    Fatal error
    : Call to undefined function send_sms() in /home/www/virtual/555.com/htdocs/contact/contact.php on line 28

    บรรทัดที่ 28 คือ

    send_sms( $google_username , $google_password , $subject ,$body );

    สคริปส่งเมล์ผมอยู่โฟเดอร์ contat
    ส่วนไฟล์ send_sms.php อยู่ข้างนอก ในเว็บผมโฟเดอร์คร่าวๆ ก็ประมาณนี้คับ
    1. home
    2.service
    ..
    5.zend
    6. send_sms.php
    7. contact (สคริปเมล์ อยู่ข้างใน)

    ไม่รู้ว่าวางตําเเหน่งอะไรผิดที่ผิดทางรึปะอ่าครับ
     

  72. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Chrome 4.0.249.64 Windows XP
    Posted 22/01/2010 at 06:27 | Permalink

    ถ้าอย่างนั้นต้องเอาโฟลเดอร์ Zend ไปไว้ในโฟลเดอร์ contact ครับ

  73. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Chrome 4.0.249.64 Windows XP
    Posted 22/01/2010 at 06:31 | Permalink

    Fatal error: Call to undefined function มันแจ้งว่า เรากำลังเรียกใช้ฟังก์ชั่นที่ไม่มีอยู่จริง

    แสดงว่าคุณ KU ไม่ได้ก้อปฟังก์ชั่น send_sms ไปไว้ในไฟล์  contact form

    ในคอมเม้นท์ 75 ผมเขียนไว้ให้หมายความว่า ให้เอาฟังก์ชั่นนั้น ไปใส่ไว้ตรงหัวของไฟล์ แล้วแทรกการส่ง SMS ไว้หลังจากส่งอีเมล์

  74. KU Firefox 3.5.7 Windows XP
    Posted 22/01/2010 at 10:38 | Permalink

    สําเร็จเเล้ว ขอบคุง platoosom มากคับ
    ผมหนับหนุนเว็บท่านไป 2 ดอก อิอิ (ทําอยู่เหมือนกัน)

  75. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.6.NETCLR3.5.30729 Windows XP
    Posted 22/01/2010 at 10:49 | Permalink

    ยินดีด้วยครับที่ทำได้แล้ว และขอบคุณมากครับสำหรับ 2 ดอก จากที่ผมแจ้งว่าจะลบคอมเม้นท์ด้านบน ตอนนี้ตัดสินใจใหม่แล้ว ว่าจะไม่ลบ เพราะกำลังจะออกแบบหน้าเว็บใหม่แล้ว

    ปัญหาเรื่องความสวยคงหมดไป เก็บคอมเม้นท์ไว้ เผื่อท่านอื่นจะได้เป็นแนวในการแก้ปัญหา

    สงสัยเราต้องรณรงค์เรื่องการจัด ประมาณว่าอ่านแล้วได้ประโยชน์ก็จัดไป 1 ดอก 2 ดอก เพื่อกำลังใจ

    คนไทยไม่ค่อยจะจัดให้กันเลย จัดไปเถอะครับ เป็นกำลังใจแก่เจ้าของเว็บ มันไม่ถึงกับรวยหรอก

  76. KU Firefox 3.5.7 Windows XP
    Posted 22/01/2010 at 11:56 | Permalink

    คับ เก็บคอมเม้นไว้ดีกว่า เพราะผมเจอเว็บท่านจากกลูเกิล
    แต่เรื่องรณรงค์เนี้ย…อย่าเชียวนะคับ โจ่งครึม..เด๋วโดนพีเกิลอุ้ม..
    มีคนโดนมาแล้ว..

    ปล.
    เดือนที่เเล้วได้คอมฯใหม่..จากพี่เิกิลนี้เเหละ..อิอิ
    เเนะนํา..ไม่ลบคอมเม้นดีเเล้วคับ
     

  77. me Firefox 3.5.7 Windows XP
    Posted 23/01/2010 at 09:52 | Permalink

    ช่วยแนะนำ Host free ที่สามารถใช้ส่ง sms ได้หน่อยคับ ขอบคุณไว้ล่วงหน้า :)

  78. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.6.NETCLR3.5.30729 Windows XP
    Posted 23/01/2010 at 10:10 | Permalink

    ไม่มีครับ

  79. me Firefox 3.5.7 Windows XP
    Posted 23/01/2010 at 10:13 | Permalink

    ต้องเป็น Host เสียเงินเท่านั้นหรอคับ

  80. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.6.NETCLR3.5.30729 Windows XP
    Posted 23/01/2010 at 10:43 | Permalink

    จริงๆแล้วน่าจะมีมั้งครับโฮสต์ที่รันสคริปต์ที่ผมเขียนขึ้นมาได้ แต่ถ้าจะใช้งานอย่างจริงจัง ไม่ควรใช้

    แต่ถ้าจะใช้เพื่อการทดสอบ ผมแนะนำให้ลองหาดูใน http://www.thaiseoboard.com ในนั้นแจกโฮสต์ฟรี เพื่อการทดสอบ กันอยู่บ่อยๆ

  81. DS_Ohm Chrome 4.0.249.89 Windows 7
    Posted 15/02/2010 at 17:26 | Permalink

    ขอบคุณมากมายครับ ผมส่งจาก localhost เครื่องผมได้เลย

    header (‘Content-type: text/html; charset=utf-8′);
    ใส่ตัวนี้ไว้บนหัวสุด เป็นไทยปกติครับ

  82. kingkong MSIE 8.0 Windows XP
    Posted 24/02/2010 at 21:29 | Permalink

    ขอโทษน่ะคับ ผมไม่มีความรู้เลย ผมเลยอยากรู้ลายละเอียดขอแบบล่ะเอียดจิงๆน่ะคับ
    ต้องใช้โปรแกรมเสริมอะไรบ้าง นอกจากโปรแกรมที่พี่ให้มา

    แล้วรายละเอียดการทำแต่ล่ะข้นตอนมีอะไนบ้าง ขอโทดน่ะคับพอดีไม่มีความรู้จิงๆ

    ขอบคุณล่วงหน้าคับ

  83. Posted 25/02/2010 at 00:11 | Permalink

    ไม่ต้องใช้อะไรเลยเพิ่มเลยคับตามที่พี่เขาบอกเลยคับ

  84. kingkong MSIE 8.0 Windows XP
    Posted 25/02/2010 at 14:22 | Permalink

    โค้ดที่ต้องเพิ่ม เพิมลงในไหนหรอคับ ช่วยอธิบายหน่อย เพิ่มในที่โฟนเดอร์ Zend หรือเพิ่มตรงไหนหรอคับ

  85. kingkong MSIE 8.0 Windows XP
    Posted 25/02/2010 at 14:56 | Permalink

    หากเป็นไปได้จะขอเมลของคนที่ทำได้แล้วเพื่อเอาไว้ปรึกษาหน่อยจะได้ไหมคับ

  86. kingkong MSIE 8.0 Windows XP
    Posted 25/02/2010 at 19:20 | Permalink

    ในโฟนเดอร์ Zend มีหลายไฟส์มาก แล้วจะนำส่วนขอโค้ดไว้ใส่ต้องไหน
    ช่วยอธิบายหน่อยน่ะคับ

    เริ่มงานไม่ถูก

  87. Posted 25/02/2010 at 23:48 | Permalink

    สร้างไฟล์ตามโค้ดนี้
    newEventEntry();

    // Populate the event with the desired information
    // Note that each attribute is crated as an instance of a matching class
    $event->title = $service->newTitle( $param_title );

    //$event->where = array($service->newWhere(“Mountain View, California”));
    $event->content = $service->newContent( $param_content );

    // Set the date using RFC 3339 format.
    $startDate = date( “Y-m-d” );//”2009-01-15″;
    $startTime = date( “H:i” , strtotime(“+3 minutes”) );
    $endDate = date( “Y-m-d” );
    $endTime = date( “H:i” , strtotime(“+6 minutes”) );
    $tzOffset = “+07″;

    $when = $service->newWhen();
    $when->startTime = “{$startDate}T{$startTime}:00.000{$tzOffset}:00″;
    $when->endTime = “{$endDate}T{$endTime}:00.000{$tzOffset}:00″;

    // Create a new reminder object. It should be set to send an email
    // to the user 10 minutes beforehand.
    $reminder = $service->newReminder();
    $reminder->method = “sms”;
    $reminder->minutes = “2″;

    $when->reminders = array($reminder);

    $event->when = array($when);

    // Upload the event to the calendar server
    // A copy of the event as it is recorded on the server is returned
    if ($newEvent = $service->insertEvent($event)){

    return true ;
    }else{

    return false;
    }

    }

    $google_username = “xxxxxxxxxxx”; // username เข้ากูเกิลของคุณ
    $google_password = “xxxxxxxxxxx”; // password เข้ากูเกิลของคุณ
    $title = “เรื่องนี้ต้องขยาย”;
    $content = “เนื่องจากนางสมศรีแอบรักกับนายสมชาย โดยพ่อสมปองไม่ทราบ”;

    // ส่ง SMS
    send_sms( $google_username , $google_password , $title ,$content );

    ?>
    ไว้ตำแหน่งเดียวกับ โฟวเดอร์ Zend
    ในโฟวเดอร์ Zend ไม่ต้องไปแก้อะไรเลยคับ

    ถ้าไม่ได้ลองทดสอบกับ Host นี้นะคับได้ผลแน่นอน 99 บาท ต่อ ปี
    http://www.myweb-zonehost.com/
    ที่ไม่ได้อาจเป็นเพราะยังไม่ได้เปิด OpenSSL คับ

  88. kingkong MSIE 8.0 Windows XP
    Posted 26/02/2010 at 00:19 | Permalink

    ผมขอเมลคุณได้ไหมคับ ไว้ปรึกษา

  89. kingkong MSIE 8.0 Windows XP
    Posted 26/02/2010 at 07:59 | Permalink

    ที่ผมหมายถึงคือ โค๊ด เอาไปวางในไหน โปรแกรมอะไร หรือไปตรงไหน หาที่วางโค๊ดไปถูก
    คือที่ผมรู้ว่ามีโคดอยู้ แต่ไม่รู้ว่านำโคดไปใส่ไปวางตรงในยังงัย
    อิอิอิอิอิ

    คนไม่เข้าใจ ขอโทดที

  90. Posted 26/02/2010 at 18:26 | Permalink

    เอาโคดไปวางในไฟล์ PHP คับ ตั้งชื่อไฟล์ตามความต้องการคับ

  91. kingkong MSIE 8.0 Windows XP
    Posted 26/02/2010 at 19:49 | Permalink

    ขอเมลไดไหมคับ ผมต้องทำงานชิ้นนี้เป็น มินิโปรเจค ผมเลยต้องคำปรึกษา อีกมาเลย ขอบคุณที่กรุณาคับ

  92. keng MSIE 7.0 Windows XP
    Posted 10/03/2010 at 09:17 | Permalink

    ผมเพิ่งจะหัดลองเล่น php ครับ
    ผมได้ลองทำตามคำแนะนำแล้ว แก็ไม่ได้ ไม่ทราบว่าผมได้ทำถูกรึป่าวนะครับ

    1.ผมก๊อปโค๊ดจากเวปนี้ทั้งหมดไว้ในไฟล์เดียวกัน ตั้งชื่อไว้ว่า send.php
    2.เปิดการใช้งาน openssl โดยการลบ ; หน้าคำสั่งในไฟล์ php.ini

    Error ที่เกิดขึ้นเป็นดังนี้
    Fatal error: Uncaught exception ‘Zend_Gdata_App_HttpException’ with message ‘Unable to Connect to ssl://www.google.com:443. Error #59012408: Unable to find the socket transport “ssl” – did you forget to enable it when you configured PHP?’ in C:\AppServ\www\GcalendarSMS\ZendGdata-1.7.3\library\Zend\Gdata\ClientLogin.php:140 Stack trace: #0 C:\AppServ\www\GcalendarSMS\ZendGdata-1.7.3\library\send.php(40): Zend_Gdata_ClientLogin::getHttpClient(‘username’, ‘password’, ‘cl’) #1 C:\AppServ\www\GcalendarSMS\ZendGdata-1.7.3\library\send.php(96): send_sms(‘username’, ‘password’, ‘GCalendarSMS’, ‘Hello Mr.Keng’) #2 {main} thrown in C:\AppServ\www\GcalendarSMS\ZendGdata-1.7.3\library\Zend\Gdata\ClientLogin.php on line 140

    เมื่อเปิดไปดูใน
    C:\AppServ\php5\extras\openssl ก็พบ openssl นะครับ

    รบกวนผู้รู้ทั้งหลายมาชี้ทางสว่างด้วยนะครับ

    ขอบคุณมากครับ

  93. nightmare MSIE 6.0 Windows XP
    Posted 11/03/2010 at 11:11 | Permalink

    ติด proxy น่ะครับ ไม่ทราบว่าทำยังไงเหรอครับ ลอง set ค่าใน php.ini แล้วก็ยังไม่ได้ ลองตามอ่านความเห็นของคนอื่น ๆ ก็อไม่เห็นมีบอก บอกแต่ว่าผ่านหมดแล้วแต่ไม่ได้อธิบายรายละเอียดไว้ แต่เท่าที่ลองคิดดูมันก็น่าจะ set ที่ php.ini ก็น่าจะผ่านแล้วแต่ก็ยังไม่ผ่านเลยอยากสอบถามวิธีการหน่อยครับ

  94. nightmare MSIE 6.0 Windows XP
    Posted 11/03/2010 at 11:12 | Permalink

    อ่อเมื่อกี้ลืมบอกไปครับว่า พอไปลองด้านนอกที่ไม่ผ่าน proxy มันสามารถออกได้นะครับแต่พอมาลองกับหน่วยงานแล้วมันติดน่ะครับ

  95. kingkong MSIE 8.0 Windows XP
    Posted 12/03/2010 at 13:41 | Permalink

    คนไหนทำได้แล้วผมจะขอเมลได้ไหมคับ

  96. ree MSIE 6.0 Windows XP
    Posted 23/03/2010 at 00:33 | Permalink

    แล้วมันไม่ละเมิดไรไครใช่มั้ยคะ

  97. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.6 Windows XP
    Posted 23/03/2010 at 08:39 | Permalink

    ไม่ละเมิดครับ เพราะว่ามันจะส่งหาได้เฉพาะคนที่เรารู้รหัสผ่านเข้า google ของเขาเท่านั้น

    นั่นหมายความว่า ถ้าไม่ใช่เพื่อน ก็แฟน พ่อ แม่ พี่ น้อง ญาติ

  98. Posted 12/04/2010 at 09:30 | Permalink

    สามารถส่งได้มากกว่า 1 เบอร์มั้ยค่ะ ต้องตั้งค่าตรงไหน

    • วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.6.3.NETCLR3.5.30729 Windows XP
      Posted 15/04/2010 at 06:05 | Permalink

      ส่งได้ครับ ก็ใช้วิธี loop ส่งไปทีละเบอร์ ถ้า 5 รอบมันก็ได้แล้ว 5 เบอร์

  99. Posted 29/04/2010 at 08:47 | Permalink

    ดีครับทุกคน ผมได้ลองอัพโหลดสคริปขึ้นไปบน Server จริงแล้ว แต่มีปัญหาตรงที่เราเพิ่มรายการเข้าไปแล้วมันกลับไปเพิ่มอยู่ในรายการของเมื่อวาน
    (เช่นวันนี้เป็นวันที่ 29 เม.ย.แต่เราเพิ่มเข้าไปกลับไปอยู่ในรายการของวันที่ 28 เม.ย. แทน) ผมงงเลยครับ ไม่ทราบว่าพี่ๆทั้งหลาย ท่านใดที่สามารถให้ความช่วยเหลือปรึกษาได้ครับ ขอคำปรึกษาด้วยนะครับ ขอบคุณครับ..

  100. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.6.3 Windows XP
    Posted 29/04/2010 at 09:37 | Permalink

    ตอบคุณ สุรพจน์
    เหตุการณ์ที่ท่านเจอ เกิดจากเวลาของเซิฟเวอร์ เขาตั้งช้าไปหนึ่งวัน วิธีแก้ก็คือแจ้งไปบอกทางเซิฟเวอร์ว่า เวลาเซิฟเวอร์ท่านช้าเด้อ

    ้ถ้าจะทดสอบด้วยตัวเองว่า เวลาเขาตั้งไว้ผิดปกติจริงหรือไม่ ให้สร้างไฟล์ php แล้วเขียนคำสั่ง echo date(‘d-m-Y H:i:s’); รันแล้วดูว่าเวลาบนเซิฟเวอร์ถูกต้องหรือเปล่า

  101. Posted 29/04/2010 at 13:22 | Permalink

    ส่งได้ครับ ก็ใช้วิธี loop ส่งไปทีละเบอร์ ถ้า 5 รอบมันก็ได้แล้ว 5 เบอร์

    หมายถึง ให้ loop ตรงนี้หร๋อค่ะ

    $google_username = “xxxxxxxxxxx”; // username เข้ากูเกิลของคุณ
    $google_password = “xxxxxxxxxxx”; // password เข้ากูเกิลของคุณ
    $title = “เรื่องนี้ต้องขยาย”;
    $content = “เนื่องจากนางสมศรีแอบรักกับนายสมชาย โดยพ่อสมปองไม่ทราบ”;
    // ส่ง SMS
    send_sms( $google_username , $google_password , $title ,$content );

    ซึ่ง แต่ละเบอร์อาจจะต้องใช้ username และ password คนละตัวกันงี้ใช่ป่ะค่ะ

    พอดีเห็นใน google calendar สามารถเพิ่มปฏิทินของเพื่อนได้ (อันนี้เกี่ยวกันมั้ยค่ะ)

  102. Posted 29/04/2010 at 22:52 | Permalink

    ไม่ว่า Hosting ฟรีจากประเทศไหน
    ใช้โค้ดนี้คับเปลี่ยนเวลาเป็นประเทศไทย
    เอาไปใส่ไว้ด้านบนของหัวเว็บนะคับ

    date_default_timezone_set(“Asia/Bangkok”);

    Crdit : nadkk

  103. poom Firefox 3.6.2 MacIntosh
    Posted 30/04/2010 at 10:54 | Permalink

    อยากให้ส่งสถานที่ได้ด้วยครับ จะต้องเขียนอย่างไร ครับ

  104. Posted 21/05/2010 at 10:34 | Permalink

    รบกวนสอบถามหน่อยครับ

    1.มีวิธีที่จะสามารถกำหนด วัน/เดือน/ปี และ เวลา (เริ่มและจบ)ได้ไหมครับ
    กรณีที่ผมไม่อยากให้ บันทึก ณ วันที่ทำรายการครับ อาธิ ล่วงหน้า หรือ ย้อนหลัง

    2.แล้วกรณีที่จะส่งให้ได้มากกว่า 1 เบอร์ ต้องเริ่มต้น Loop ตรงไหนครับ

    ขอบคุณมากครับ
    วศิน

    • วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.6.3 Windows XP
      Posted 21/05/2010 at 10:48 | Permalink
      $startDate = date( "Y-m-d" );//"2009-01-15";
      $startTime = date( "H:i" , strtotime("+3 minutes") );
      $endDate = date( "Y-m-d" );
      $endTime = date( "H:i" , strtotime("+6 minutes") );
      $tzOffset = "+07";

      ตรงนี้ไงครับ จะกำหนดให้มันลงปีหน้า ก็ยังได้

  105. Posted 21/05/2010 at 22:09 | Permalink

    ครับผม ทำได้แล้วครับ
    ผมทำฟอร์ม ให้เลือก เวลาที่จะส่ง

    แต่การที่จะให้ส่งได้มากกว่า 1 เบอร์อะครับ
    ท่านเจ้าของเคยแจ้งว่าให้ Loop ไม่ทราบว่า
    ต้องเริ่ม Loop จากตรงไหนครับ

    ช่วยแนะนำ Code ด้วย ก็จะดีมากเลยครับ

    ขอบคุณมากครับ
    วศิน

  106. ae Firefox 3.5.9 Windows XP
    Posted 19/06/2010 at 01:33 | Permalink

    ลองแล้วค่ะ แต่มันตายที่ บรรทัด

    $newEvent = $service->insertEvent($event) นี้อ่ะค่ะ ทำไงดีคะ

  107. Marnoch MSIE 6.0 Windows XP
    Posted 31/08/2010 at 21:04 | Permalink

    ดีมากครับ และมีประโยชน์มากๆๆด้วยเช่นกัน ผมให้ 5 ดาวเลยครับ ผมเริ่มหัดเล่น php อ่านแล้วพอเข้าใจบ้าง งูงูปลาปลา

  108. Marnoch Firefox 3.5.8 Windows XP
    Posted 05/09/2010 at 08:47 | Permalink

    ผมใช้ผ่าน appserv เกิด error ไม่รู้ว่าจะแก้ไขอย่างไรครับ

    Warning: require_once(Zend/Loader.php) [function.require-once]: failed to open stream: No such file or directory in C:\AppServ\www\Zend\SMS_TEST.PHP on line 7

    Fatal error: require_once() [function.require]: Failed opening required ‘Zend/Loader.php’ (include_path=’.;C:\php5\pear’) in C:\AppServ\www\Zend\SMS_TEST.PHP on line 7

  109. t1 MSIE 6.0 Windows XP
    Posted 09/10/2010 at 17:01 | Permalink

    ทดสอบแล้วช้ากว่าเวลาจริงไป 1 ชม ต้องแก้ตรงปรับไหนครับ

  110. gift MSIE 8.0 Windows XP
    Posted 11/10/2010 at 11:18 | Permalink

    ตอนนี้มันขึ้น Error แบบนี้อะค่ะ มันเกิดอะไรขึ้นหรอค่ะ กิ๊ฟใช้ xampp ค่ะ ลองเช็คดูแล้ว openssl ก็เปิดอยู่นะค่ะ แต่ว่า ไอ้ตัว file com.php หาไม่เจอเลย หรือว่าทำอะไรผิดรึเปล่าอะค่ะ

    Fatal error: Uncaught exception ‘Zend_Exception’ with message ‘File “Zend\Validate\Hostname\Com.php” does not exist or class “Zend_Validate_Hostname_Com” was not

  111. t1 MSIE 6.0 Windows XP
    Posted 12/10/2010 at 09:57 | Permalink

    แต่การที่จะให้ส่งได้มากกว่า 1 เบอร์อะครับ
    ท่านเจ้าของเคยแจ้งว่าให้ Loop ไม่ทราบว่า
    ต้องเริ่ม Loop จากตรงไหนครับ

    อยากทราบตรงนี้ครับ ช่วยกรุณาเป็นวิทยาทานด้วยนะครับ ขอบคุณครับ

  112. pen Chrome 7.0.517.41 Windows 7
    Posted 01/11/2010 at 15:09 | Permalink

    พี่ค่ะ ทำไมมันเข้าส่ง title แต่ content ไม่ส่งเข้าค่ะ เช็คดูตัวแปรก็มีค่านะค่ะ และดูในปฏิทิน google ก็มีค่าครบทุกอย่าง แบบนี้น้องต้องแก้ตรงไหนหรอค่ะ T_T

  113. วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 3.6.12 Windows XP
    Posted 01/11/2010 at 15:16 | Permalink

    กูเกิลจะส่งให้เฉพาะไตเิติลครับ ส่วนเนื้อหาที่เราใส่เข้าไปด้วย เพื่อทำให้รายการบนเว็บสมบูรณ์เท่านั้น

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

  114. yukihoo MSIE 8.0 Windows XP
    Posted 03/11/2010 at 16:50 | Permalink

    Uncaught exception ‘Zend_Gdata_App_HttpException’ with message ‘Unable to Connect to tcp://www.google.com:80. Error #10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ‘ in D:\AppServ\www\repair\Zend\Gdata\App.php:626 Stack trace: #0 D:\AppServ\www\repair\Zend\Gdata.php(206): Zend_Gdata_App->performHttpRequest(‘POST’, ‘http://www.goog…’, Array, ‘performHttpRequest(‘POST’, ‘http://www.goog…’, Array, ‘post(Object(Zend_Gdata_Calendar_EventEntry), ‘http://www.goog…’, NULL, NULL, Array) #3 D:\AppServ\www\repair\Zend\Gdata\Calendar.php(164): Zend_Gdata_App->insertEntry(Object(Zend_Gdata_Calendar_EventEntry), ‘http://www.goog…’, ‘Zend_Gdata_Cale…’) #4 in D:\AppServ\www\repair\Zend\Gdata\App.php on line 626

    แก้ไขครับ

  115. yukihoo MSIE 8.0 Windows XP
    Posted 03/11/2010 at 16:51 | Permalink

    แก้ยังไงหรอครับ

  116. tor Chrome 7.0.517.41 Windows XP
    Posted 04/11/2010 at 10:15 | Permalink

    ฝั่งรับ (โทรศัพท์มือถือ) รับได้หลายๆเบอร์ได้ไหม

  117. t1 MSIE 6.0 Windows XP
    Posted 15/11/2010 at 09:37 | Permalink

    ส่งแบบหลายเบอร์ครับ โดยใช้ loop ครับ (ตามตัวอย่ง code จะได้ 4 เบอร์ครับ)
    รูปแบบคือ จะแสดงผลลัพธ์ ตามคำสั่งเงื่อนไข sql ที่เรียกดึงข้อมูลมาจากฐานข้อมูล แล้วให้แสดงผลลัพธ์ที่หน้าจอพร้อมกับส่ง sms ไปด้วย

    ลองดูนะครับ เผื่อจะมีประโยชน์บ้างสำหรับมือใหม่ครับ
    ขอขอบคุณ select2web.com และ ThaiCreate.Com และ google ที่ให้ความรู้มา ณ ที่นี้

    ThaiCreate.Com PHP & SQL Server Tutorial

    newEventEntry();

    // Populate the event with the desired information
    // Note that each attribute is crated as an instance of a matching class
    $event->title = $service->newTitle( $param_title );

    //$event->where = array($service->newWhere(“Mountain View, California”));
    $event->content = $service->newContent( $param_content );

    // Set the date using RFC 3339 format.
    $startDate = date( “Y-m-d” );//”2009-01-15″;
    $startTime = date( “H:i” , strtotime(“+3 minutes”) );
    $endDate = date( “Y-m-d” );
    $endTime = date( “H:i” , strtotime(“+6 minutes”) );
    $tzOffset = “+07″;

    $when = $service->newWhen();
    $when->startTime = “{$startDate}T{$startTime}:00.000{$tzOffset}:00″;
    $when->endTime = “{$endDate}T{$endTime}:00.000{$tzOffset}:00″;

    // Create a new reminder object. It should be set to send an email
    // to the user 10 minutes beforehand.
    $reminder = $service->newReminder();
    $reminder->method = “sms”;
    $reminder->minutes = “2″;

    $when->reminders = array($reminder);

    $event->when = array($when);

    // Upload the event to the calendar server
    // A copy of the event as it is recorded on the server is returned
    if ($newEvent = $service->insertEvent($event)){

    return true ;
    }else{

    return false;
    }

    }

    $title1 = $objResult["ฟิลด์1"];
    $title2 = $objResult["ฟิลด์2"];
    $title3 = $objResult["ฟิลด์3"];
    $title4 = $objResult["ฟิลด์4"];
    $title5 = $objResult["ฟิลด์5"];
    $title6 = number_format($objResult["ฟิลด์6"]);

    $title = “ตัวอักษรที่ให้แสดง “. ” “. $title1. ” (“. $title2. “) “. $title3. ” “. $title4. ” “. iconv(“tis-620″, “utf-8″, $title5). ” “. $title6;

    $content = “ตัวอักษรที่ให้แสดง “. ” “. $title1. ” (“. $title2. “) “. $title3. ” “. $title4. ” “. iconv(“tis-620″, “utf-8″, $title5). ” “. $title6;

    echo $title;

    $num = 1; //กำหนดให้มีค่าเริ่มต้นเท่ากับ 1
    while ($num

  118. t1 MSIE 6.0 Windows XP
    Posted 15/11/2010 at 10:22 | Permalink

    พอดีผมโพส์ไม่เป็น ลองดูที่นี่นะครับ http://upload.one2car.com/download/download.aspx?pku=23316D2DF743GJ2HICX2Y6JLMFKSDN

  119. tor Firefox 3.6.12 Windows XP
    Posted 17/11/2010 at 09:29 | Permalink

    ขอบคุณมากครับ
    จะหัดทำตามครับ

  120. auikung Firefox 3.6.12 Windows 7
    Posted 09/12/2010 at 19:49 | Permalink

    Warning: require_once(Zend/Loader.php) [function.require-once]: failed to open stream: No such file or directory in C:\AppServ\www\coolwifi\Zend\sms.php on line 7

    Fatal error: require_once() [function.require]: Failed opening required ‘Zend/Loader.php’ (include_path=’.;C:\php5\pear’) in C:\AppServ\www\coolwifi\Zend\sms.php on line 7

    มันขึ้น error แบบนี้อะครับ ยังไงอะครับ

  121. GEETEE MSIE 7.0 Windows XP
    Posted 05/02/2011 at 15:36 | Permalink

    ลองแล้วขึ้นแบบนี้ครับ ลองใน localhost นะครับ ขอคำแนะนำด้วยครับ
    Fatal error: Uncaught exception ‘Zend_Gdata_App_HttpException’ with message ‘Unable to Connect to ssl://www.google.com:443. Error #8429033: ‘ in C:\xampp\htdocs\MSC\Zend\Gdata\ClientLogin.php:140 Stack trace: #0 C:\xampp\htdocs\MSC\sendsms.php(41): Zend_Gdata_ClientLogin::getHttpClient(‘Test1@hotm…’, ‘test1…’, ‘cl’) #1 C:\xampp\htdocs\MSC\sendsms.php(95): send_sms() #2 {main} thrown in C:\xampp\htdocs\MSC\Zend\Gdata\ClientLogin.php on line 140

  122. Kan Chrome 9.0.597.98 Windows 7
    Posted 13/02/2011 at 18:00 | Permalink

    Warning: require_once(Zend_Loader.php) [function.require-once]: failed to open stream: No such file or directory in C:\AppServ\www\Zend\library\Zend\send_sms.php on line 7

    Fatal error: require_once() [function.require]: Failed opening required ‘Zend_Loader.php’ (include_path=’.;C:\php5\pear’) in C:\AppServ\www\Zend\library\Zend\send_sms.php on line 7

    ปัญหานี้- ไม่ได้ กำหนด include_path ใน php.ini ใช่มั้ยคะ
    แล้วจะแก้ตรงไหนยังไง

  123. lekkk MSIE 8.0 Windows XP
    Posted 12/03/2011 at 14:10 | Permalink

    คืออยากจะเขียนโปรแกรมเป็นอะค่ะแต่ไม่มีความรู้เรื่องนี้เลย
    แต่มีความสนใจมากอยากจะขอคำแนะนำหน่อยค่ะว่าจะต้องเริ่มต้นยังไงค่ะ

    ขอบคุณค่ะ

  124. watchapol Firefox 3.6.15 Windows XP
    Posted 18/03/2011 at 14:50 | Permalink

    ในปัจจุบัน Zend เวอร์ 1.7.3 ไม่ สนับสนุนการทำงานsrc codeนี้ แล้วนะครับ
    เนื่องจาก ขาด file Zend\Validate\Hostname\Com.php

    ต้อง download Zend เวอร์ 1.9.4 แทนครับ
    http://framework.zend.com/releases/ZendGdata-1.9.4/ZendGdata-1.9.4.zip

  125. kan Firefox 4.0 Windows 7
    Posted 06/04/2011 at 05:45 | Permalink

    ถ้าจะส่งพร้อมกันหลายๆคนทำได้รึเปล่าครับ

    • Posted 17/12/2011 at 15:30 | Permalink

      ส่งได้ทีละคนแต่ให้วน Loop ส่งหลายๆคนได้ครับ โดยดึง u-gmail และ g-pass จากฐานข้อมูล

  126. Posted 25/05/2011 at 11:50 | Permalink

    เทพๆกันทั้งนั้นเลยเว็บนี้ คาราวะ

    • วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 4.0.1 Windows 7
      Posted 27/05/2011 at 00:15 | Permalink

      ขอบอกตามตรงว่าบทความนี้ เขียนขึ้นจากความต้องการของตัวเอง เฉพาะ แบบว่าอยากได้ของดีแต่ไม่อยากเสียตัง และมันก็ตอบโจทย์ของเราเสียด้วย

  127. A Chrome 11.0.696.68 Windows XP
    Posted 27/05/2011 at 10:24 | Permalink

    หน่วยงานผมมันติด poxy ครับ

    มันerror

    Fatal error: Uncaught exception ‘Zend_Gdata_App_HttpException’ with message ‘Unable to Connect to ssl://www.google.com:443. Error #-1080223588: ‘ in /opt/lampp/htdocs/mkis/Zend/Gdata/ClientLogin.php:140 Stack trace: #0 /opt/lampp/htdocs/mkis/sms.php(40): Zend_Gdata_ClientLogin::getHttpClient(‘xxx@gmail.co…’, ‘passs’, ‘cl’) #1 /opt/lampp/htdocs/is/sms.php(94): send_sms(‘xxx@gmail.co…’, ‘passs’, ‘TEST’, ‘SMS TEST’) #2 {main} thrown in /opt/lampp/htdocs/is/Zend/Gdata/ClientLogin.php on line 140

    จะแก้ไขยังไงดีครับ

  128. k Chrome 10.0.648.127 Windows 7
    Posted 02/06/2011 at 17:00 | Permalink

    ขอบคุณครับ สำหรับบทความนี้
    ผมทำตามแล้ว ตอนนี้สามารถส่ง event เข้าไปได้แล้วครับ แต่ไม่มี sms ส่งกลับมาเมื่อถึงเวลาครับ
    แต่ถ้าลองเข้าไปเพิ่ม event เองจากหน้าเว็บของ google calendar จะมี sms มาครับ

    ผมจึงลองเปลี่ยน code จาก $reminder->method = “sms”; เป็น $reminder->method = “alert”; ปรากฎว่า หน้าเว็บ google calendar ที่ login ค้างใว้ มี popup แสดงขึ้นมาเตือนเมื่อถึงเวลาครับ ก็เลยคิดว่าไม่น่าจะเป็นที่ Timezone ครับ

    ไม่ทราบว่าน่าจะเกิดจากสาเหตุใดได้อีกบ้างครับ
    ขอบคุณครับ

  129. Posted 07/06/2011 at 21:31 | Permalink

    เจ๋งมากครับ ได้ความรู้ดีมากเลย ไว้จะลองเอาไปเขียนดูนะครับ ^^

  130. Posted 08/06/2011 at 14:05 | Permalink

    ชอบมากครับ เขียนวิธีละเอียดดีมากๆเลยครับ

  131. จูน Firefox 4.0.1 Windows XP
    Posted 10/06/2011 at 18:37 | Permalink

    ช่วยแสดงตัวอย่างสคริปต์ที่สามารถส่งได้พร้อมกันหลาย ๆ เบอร์ ได้ไหมคะ

    • Posted 17/12/2011 at 16:07 | Permalink

      *หมายเหตุส่งได้ทีละคนแต่สามารถส่งได้หลายๆคนใช้(Loop)

      1.สร้างไฟล์ smsconfig.php

      2. สร้างไฟล์ sent_sms.php

      * แค่นี้คุณก็จะสามารถส่งข่าวหรือ SMS ให้เพื่อนๆทุกคนได้แล้วครับ..Code ผิดประการใดต้องขออภัย ณ ที่นี้ด้วย

    • Posted 19/12/2011 at 09:35 | Permalink

      Code ตัวอย่างการ วน Loop ส่งให้หลายๆคน ครับ http://www.cattareenflowerthai.com/sentsms.pdf

  132. Posted 14/06/2011 at 09:11 | Permalink

    ขอบคุณพี่ administrator มากครับ Server มันอยู่ต่างประเทศเวลาเลยต่างกันครับ ผมอัพขึ้น Server ในไทยแล้วทำงานได้ดีครับ ขอบคุณครับ..

  133. จูน Firefox 4.0.1 Windows XP
    Posted 16/06/2011 at 10:48 | Permalink

    ไม่เห็นมีใครตอบมาบ้างเลยคะ
    ช่วยแสดงตัวอย่างสคริปต์ที่สามารถส่งได้พร้อมกันหลาย ๆ เบอร์ ได้ไหมคะ

  134. แจน Firefox 4.0.1 Windows XP
    Posted 17/06/2011 at 09:08 | Permalink

    เขียนเว็บส่ง SMS ด้วย Google calendar แต่พออัพเว็บขึ้นเน็ต แล้วส่ง SMS ไม่ได้ แต่ข้อมูลได้ถูกบันทึกไว้ในปฏิทิน ไม่ทราบว่าต้องใช้ Application ตัวใดเสริมบ้าง ช่วยตอบให้หน่่อยนะค่ะ ขอบคุณค่ะ

  135. k MSIE 8.0 Windows XP
    Posted 17/06/2011 at 14:32 | Permalink

    มาถามอีกทีครับ

    ผมทำตาม ตอนนี้สามารถส่ง event เข้าไปได้แล้วครับ แต่ไม่มี sms ส่งกลับมาเมื่อถึงเวลาครับ
    แต่ถ้าลองเข้าไปเพิ่ม event เองจากหน้าเว็บของ google calendar จะมี sms มาครับ

    ผมจึงลองเปลี่ยน code
    จาก $reminder->method = “sms”;
    เป็น $reminder->method = “alert”;

    ปรากฎว่า หน้าเว็บ google calendar ที่ login ค้างใว้ มี popup แสดงขึ้นมาเตือนเมื่อถึงเวลาครับ ก็เลยคิดว่าไม่น่าจะเป็นที่ Timezone ครับ

    ไม่ทราบว่าน่าจะเกิดจากสาเหตุใดได้อีกบ้างครับ
    ขอบคุณมากครับ

  136. de_boy Chrome 13.0.782.220 Windows 7
    Posted 11/09/2011 at 15:23 | Permalink

    code php ตัวนี้
    เราสามารถให้ c# เรียกใช้ code เหล่านี้ได้รึเปล่าคะ?

    ถ้าได้ ต้องใช้ library อะไรร่วมด้วยรึเปล่าคะ?

    พอดีว่าเขียนโปรแกรมด้วย c# มาเยอะพอสมควรแล้ว
    แต่อยากได้ การส่งของ google calendar sms เตือน

    ขอบคุณมากค่ะ

  137. Posted 13/09/2011 at 15:07 | Permalink

    เยี่ยมไปเลยครับ

  138. Posted 22/09/2011 at 10:44 | Permalink

    ผลที่ได้คือ

    bool(true)

    สรุปใช้ได้ รายการใน Calendar ถูกเพิ่มเข้าไป

    เพียงแต่ไม่มี SMS ส่งมา ทั้งๆ ที่ ยืนยัน SMS เรียยร้อยแล้ว

  139. Posted 22/09/2011 at 10:51 | Permalink

    ตอนนี้ เดาว่า น่าจะเป็นที่เวลาของ Server ผมมันช้าไป เลยทำให้ ตอน ADD ข้อมูล เหมือนเรา ADD ข้อมุลที่เลยการแจ้งไปแล้ว

    จึงไม่มี SMS ส่งมานั้นเอง

    ตอนนี้ลองเปลียนจาก

    $reminder->minutes = “2″;

    เป็น

    $reminder->minutes = “10″;

    ดู หุหุ

  140. kl MSIE 8.0 Windows 7
    Posted 12/11/2011 at 15:51 | Permalink

    ผมทำโปรเจคย่อยส่ง อาจารย์ ผมต้องการส่งข้อความไปยังบุคคลอื่นโดยไม่ใช่รหัสผ่านได้ไหม
    เพราะจะเอามาประยุกต์กับระบบการแจ้งเตือนการประชุมครับ ซึ่งถ้าให้ user ทุกคนกรอกเมลล์และรหัสผ่านมาเก็บไว้ในฐาน
    แล้ววนวูปดึงค่ามาเพื่อส่งไปยังผู้รับ อันนี้ผมทำได้แล้ว แต่ติดที่ว่า อาจารย์บอกว่าไม่ปลอดภัยตรงที่เราเก็บรหัสเมลล์ของคนอื่นไว้ ถึงแม้ผมจะเข้ารหัสแล้ว แต่แกก็ไม่เอา เลยรบกวนถามว่าได้ไหม ถ้าไม่ได้จะมี script php ที่ใช้ host sms ฟรี ที่ไหนบ้าง
    รบกวนด้วย จริงๆ

    • วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 8.0 Windows 7
      Posted 13/11/2011 at 08:35 | Permalink

      ไม่ได้ครับผม เพราะกูเกิลคาเลนดาร์ไม่ใช่ระบบส่ง SMS ฟรี ผมเพียงประยุกต์เอามันมาใช้ฟรีๆเท่านั้น ส่วน host sms ฟรี ไม่มีครับ มีแต่แบบเสียตังส์

      • kl MSIE 8.0 Windows 7
        Posted 15/11/2011 at 09:53 | Permalink

        http://www.ozekisms.com/index.php?owpn=327
        พี่ช่วยดูหน่อยว่าทำได้ไหม

        • วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 8.0 Windows 7
          Posted 15/11/2011 at 18:47 | Permalink

          ตัว ozekisms ไม่ใช่ตัวฟรีครับ อีกอย่างมันเป็นโปรดักที่ไว้ใช้ทำ sms gateway

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

          ในเว็บ thaiseo.com ผมเคยเห็นประกาศให้บริการหลายท่าน ลองเข้าไปสอบถามข้อมูลจากในนั้นได้

          พวกที่ให้บริการ SMS gateway เขาจะคิดเมสเสจละประมาณ 50 ตังส์ ถ้าผมจำไม่ผิดนะ ตอนทดสอบโปรแกรมเราก็อย่าทดสอบบ่อย และตอนส่งอาจารย์ ก็บอกอาจารย์ว่า จารย์ครับอย่ากดทดสอบมากครับ ผมไม่มีเงินจ่ายค่า SMS

          จากนั้นจึงอธิบายหลักการเขียนโค้ดเชื่อมต่อกับ SMS gateway ให้อาจารย์ฟังให้ละเอียด ผมเชื่อว่าอาจารย์จะเห็นใจ

          อีกอย่างหนึ่งที่ไม่ควรจะมองข้าม เวลาเอางานไปส่งอาจารย์ ให้ถือขนมไปฝากอาจารย์บ้าง กล้วยแขกข้างทางก็ได้ครับ ไปทุกครั้งซื้อของเล็กๆน้อยๆไปทุกครั้ง ปฎิบัติกับอาจารย์ให้เหมือนกับที่เราจีบหญิง ผมรับรองทุกสิ่งทุกอย่างจะดีขึ้นลับหูลับตาเลยครับ

  141. de_boy MSIE 8.0 Windows 7
    Posted 13/11/2011 at 10:49 | Permalink

    ไม่ทราบว่าก่อนหน้าที่ api ของพี่มันมีปัญหารึเปล่าคะ?
    พอดีเคยลองๆเทสไว้ แล้วอยู่ ๆมันอก็ไม่ส่งอะไรมาแจ้งเลย ทั้งๆที่ลองปิดเครื่อง server

  142. Posted 29/11/2011 at 11:26 | Permalink

    หน้า from การส่งข้อมูล tis-620 แล้วฟังชั่น sent-sms ที่สร้างใหม่ ก็ encode = tis-620 แล้ว โค้ด Loader.php ก็สั่งให้มัน encode = tis -620 แต่ทำไม จะมันยังเป็ฯภาษามนุษย์ต่างดาวคะ

    • วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย administrator Firefox 8.0.1 Windows 7
      Posted 30/11/2011 at 08:12 | Permalink

      ผมเขียนย้ำเตือนไว้ในบทความแล้วนะว่า

      **** ย้ำเตือนนะครับ ****

      ต้องใช้ UTF-8 เท่านั้น
      ส่วนเรื่องเวลา จะขึ้นอยู่กับว่าโฮสต์ของท่านตั้งอยู่ประเทศไหน ถ้าไม่ได้อยู่ในไทย ก็แก้ตรงนี้ $tzOffset = “+07″;

      อ่านบทความจนเข้าใจแล้วจึงทำตาม หรือสักแต่ว่าจะก้อปปี้อย่างเดียว น่าตีให้ตาย

      • Posted 30/11/2011 at 09:39 | Permalink

        ตอนนี้งานทีทำเดิม ม้ันเป็ฯ tis หนะคะ แล้ว database ก็ เก็บเป็น tis คะ แล้ว พอแก้ ทั้ง database และก็ โค้ดทั้งหมด เป็น utf แล้ว มันก็ไม่เป็นภาษาไทยหนะคะ

        • วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย วัชรเมธน์ ชิษณุคุปต์ ศรีเนธิโรทัย Firefox 8.0.1 Windows 7
          Posted 01/12/2011 at 07:51 | Permalink

          ผมเคยเขียนบทความวิธีการแปลงฐานข้อมูลให้เป็น utf8 ด้วย navicat ลองใช้ตัวค้นหา หาดู ตอนนี้แทบไม่มีใครใช้แล้ว tis620

  143. May Chrome 15.0.874.121 Windows 7
    Posted 30/11/2011 at 19:06 | Permalink

    ได้แล้วค่ะ ขอบคุณสำหรับความรู้ดีๆแบบนี้
    ทีแรกก็ติดตรงที่ภาษาไทยกับ SMS มันไม่ยอมส่งเหมือนกันค่ะ
    เอาโค้ด

    ไปใส่ มันก็ยังเป็นภาษาต่างด้าว
    **แก้ปัญหาโดย :
    ลองไปดูที่ Browser นะคะว่าตั้งค่าให้เป็น utf-8 รึเปล่า
    แล้วตอนที่เรา Save File จะมี Encoding อยู่ข้างล่างอ่ะคะ อย่าลืมเลือกเป็น UTF-8 ด้วยนะคะ ^__^
    (ไม่รู้ว่าเกี่ยวมั้ยนะคะ แต่เราทำแล้วมันได้ผล)
    นอกเหนือจากนั้นก็ทำตามที่คุณ “administrator” แนะนำทุกอย่าง

  144. Guide Chrome 15.0.874.121 Windows 7
    Posted 11/12/2011 at 05:50 | Permalink

    พี่ครับ ตอนนี้ script นี้ยังใช้งานได้อยู่มั้ยครับ ผมลอง test มาทั้งคืนแล้วครับ ใช้ได้แต่ method alert แต่ถ้า set manual ใช้ได้ทุก method ครับ (alert, sms, email) ผมลองอ่านกระทู้ในเว็บนี้ตั้งแต่ อันแรก ถึง สุดท้าย แต่แก้ไม่ได้ครับ ผมไปเปิด API เขียนใหม่ ก็เป็นเหมือนเดิมครับ แค่อยากให้พี่ช่วย Confirm ว่ามันยังใช้ได้อยู่จริง ผมได้พยายามแก้ต่อครับ รบกวนตอบด้วยครับ

  145. Posted 13/12/2011 at 09:07 | Permalink

    ขอสอบถาม คุณ admin คะ กรณี โค้ดนี้ เราสามารถเพิ่มกิจกรรมไปยังปฏิทินใน googel แต่ถ้าจะแก้ไขกิจกรรม หรือลบกิจกรรมทิ้งไป ไม่ทราบว่า ทาง google จะเปิดให้ api ทำงาน แบบที่ว่ามั้ยคะ ขอบคุณคะ

  146. Posted 19/12/2011 at 14:09 | Permalink

    ผมว่า Server Google มันมั่วๆ ยังไงไม่รุ้

    จากตอนแรกๆ ไม่เคยส่ง SMS มาเลย

    พอเปลียนมาใช้ส่งแบบ Email ก็ส่งบ้าง ไม่ส่งบ้าง

    แล้วาตอนนี้เพิ่งจะผ่านไป 7 วัน

    ผมลองเปลียนมา alert แบบ sms

    ใช้ได้เฉย

    มันส่ง sms มาเตือน

    แต่บางครั้ง มันดีเลย์หลายชั่วโมง

    และบางครั้ง ไม่ส่งมาก็มี

  147. de_boy Chrome 16.0.912.63 Windows 7
    Posted 24/12/2011 at 16:15 | Permalink

    สงสัยค่ะ sms ฟรี google เขามี limit ไหมคะ?
    เพราะตอนนี้ เบอร์ที่ใช้อยู่ มันไม่ส่งมาแล้ว เลยต้องเปลี่ยนเบอร์แทน
    ขอบคุณค่ะ

  148. nut MSIE 8.0 Windows 7
    Posted 17/01/2012 at 12:23 | Permalink

    ผมลองทำดูแล้ว มัน error แบบนี้ง่ะ
    ลองไปลบ ; อยู่ใน php.ini แล้ว บริเวณ OpenSSL น่ะ
    เข้าไปดูที่ php5/extra/ มันก็มี openssl อยู่
    ไม่รู้จะทำไงดี เอาเรื่องนี้ทำเป็นโปรเจคด้วย
    ใครรู้ช่วยตอบที
    เมล์ของผม nutnakrab@hotmail.com ผมออนอยู่ใครทำได้แล้ว
    ช่วยหน่อยครับ จะเป็นพระคุณอย่างสูง

    Fatal error: Uncaught exception ‘Zend_Gdata_App_HttpException’ with message ‘Unable to Connect to ssl://www.google.com:443. Error #24: Unable to find the socket transport “ssl” – did you forget to enable it when you configured PHP?’ in C:\AppServ\www\Zend\Gdata\ClientLogin.php:140 Stack trace: #0 C:\AppServ\www\sendsms.php(40): Zend_Gdata_ClientLogin::getHttpClient(‘prasongchaiwan@…’, ’046033588′, ‘cl’) #1 C:\AppServ\www\sendsms.php(94): send_sms(‘prasongchaiwan@…’, ’000000000′, ‘???????????????…’, ‘???????????????…’) #2 {main} thrown in C:\AppServ\www\Zend\Gdata\ClientLogin.php on line 140

Post a Comment

You must be logged in to post a comment.