|  |  | 
          
            | ได้ ทำตามตัวอย่าง จากลิงค์นี้ครับ 
 ถึงขั้นตอน ให้ตั้งค่า กับมือถือ มันไม่มีให้ตั้งค่า ไม่ทราบว่าจะแก้อย่างไร ครับ
 
 
  
 โค๊ดที่สร้าง คือไฟล์ send_telephone.php
 Code (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>
<?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 = "************"; // username เข้ากูเกิลของคุณ
$google_password = "************"; // password เข้ากูเกิลของคุณ
$title = "เรื่องนี้ต้องขยาย";
$content = "เนื่องจากนางสมศรีแอบรักกับนายสมชาย โดยพ่อสมปองไม่ทราบ"; 
 
// ส่ง SMS
send_sms( $google_username , $google_password , $title ,$content );
 
?>
</body>
</html>
 
 
 Tag : PHP, JavaScript, VBScript, Ajax, jQuery
 
 
 |  
            |  |  
            | 
              
                |  |  |  |  
                |  | 
                    
                      | Date :
                          2016-02-27 10:19:03 | By :
                          rock_rock | View :
                          862 | Reply :
                          1 |  |  |  
                |  |  |  |  |  
            |  |  
		            |  |