Send URL in standard SMS txtlocal api

I am using txt local to send standard SMS's (not MMS) to phones. I want to be able to send a URL in the SMS - I know this is possible but I cant seem to be able to do it - I can sort of do it using MMS. I have included my code
Can anyone tell me how to do this please?
I have included my code.

class sms{

	public 	$from,

	function sms(){
                $CI =& get_instance();

	function wappush($wappush=true){

	function to($to){

	function cc($no){

	function msg($msg){
         * e.g 2008-03-28-14-56-00
        function schedule($time){

	function send(){
		$data = "uname=".$this->username.
			"&from=". $this->from.
                 $data.=($this->shed!="")?"&shed=".$this->shed:"";#If scheduled time then set it
                 $data.=($this->wappush!=false)?"&url=".$this->wappush:"";#If  push then send url

		// Send the POST request with cURL
		$ch = curl_init($this->api);
		curl_setopt($ch, CURLOPT_POST, true);
		curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		$result = curl_exec($ch); //This is the result from Txtlocal


Open in new window

Who is Participating?
Ray PaseurConnect With a Mentor Commented:
Not sure what might happen if you try to send an HTML link with an SMS message.  IIRC SMS is purely plain-text.  So maybe it is the wrong tool for sending HTML.  If you want to try and text me with this script, please send the text to 703.346.0600
jdav357Author Commented:
Please note I added this line;
$data.=($this->wappush!=false)?"&url=".$this->wappush:"";#If  push then send url

but did not work..
Ray PaseurCommented:
Do you mean to send a URL or an anchor-tag encoded link?  A URL should just be a plain text string, right?
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

jdav357Author Commented:
Ah sorry - yes i mean an anchor tag.
jdav357Author Commented:
Hi thanks, I am now trying to send it as an MMS, but for some reason the code is not working. As the question is now substantially different to my original one, I will close the question and award you the points.
Thanks again for your help.
Ray PaseurCommented:
Thanks for the points.  Sorry I cannot be a guinea pig for MMS - I have a dumb phone :-(

Best, ~Ray
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.