From 959d08cbfe5af61a6696d56a7a7c6cb47fbbb2ae Mon Sep 17 00:00:00 2001 From: Jack-Benny Persson Date: Thu, 31 Jul 2014 19:31:27 +0200 Subject: [PATCH] Added expiry and type, tested and working --- class.php | 12 +++++++++--- httptest.php | 9 --------- 2 files changed, 9 insertions(+), 12 deletions(-) delete mode 100644 httptest.php diff --git a/class.php b/class.php index 137a7f3..d51e90c 100644 --- a/class.php +++ b/class.php @@ -33,11 +33,13 @@ class Cellsynt public $phone; public $concat; public $charset; + public $type; + public $expiry; public $msg; public function __construct($username, $password, $origType = "alpha", $originator = "Cellsynt", $concat = 6, - $charset = "UTF-8") + $charset = "UTF-8", $type = "text") { $this->username = $username; $this->password = $password; @@ -45,13 +47,17 @@ class Cellsynt $this->originator = $originator; $this->concat = $concat; $this->charset = $charset; + $this->type = $type; } - public function sendSMS($phoneNr, $msg) + public function sendSMS($phoneNr, $msg, $expiry = "") { $this->msg = $msg; $this->phoneNr = $phoneNr; - $url = "http://se-1.cellsynt.net/sms.php?username=$this->username&password=$this->password&destination=$this->phoneNr&originatortype=$this->origType&originator=$this->originator&allowconcat=$this->concat&charset=$this->charset&text=$this->msg"; + $this->expiry = $expiry; + + $url = "http://se-1.cellsynt.net/sms.php?username=$this->username&password=$this->password&destination=$this->phoneNr&originatortype=$this->origType&originator=$this->originator&allowconcat=$this->concat&charset=$this->charset&type=$this->type&expiry=$this->expiry&text=$this->msg"; + $urlFormatted = preg_replace("/\s/", "%20", $url); $ch = curl_init($urlFormatted); curl_setopt($ch, CURLOPT_HEADER, 0); diff --git a/httptest.php b/httptest.php deleted file mode 100644 index da7b329..0000000 --- a/httptest.php +++ /dev/null @@ -1,9 +0,0 @@ -