Re: what to do to send SMS from a website?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



--- In php-objects@xxxxxxxxxxxxxxx, Imran <imransaieen@...> wrote:
>
> Dear friends,
> 
> There is a need to send and receive SMS from a PHP based website to/from
> mobile phones. Which PHP software should be used to make it working?
> 
> Thanks for your knowledge sharing,
> Imran
> 
> 
> [Non-text portions of this message have been removed]
>

You dont need any software in particular, you just need to mail it to
the right provider.

See Below:

<code>

//Someone is sending an SMS
   if ( $_POST['sms-submit']=='send' ) {
		
// $options['provider'] contains the whole provider string, split to
format/server - I use Tmobile UK
			
$options['provider'] = '0n@xxxxxxxxxxxxxxx';

$provider_data=explode("@",$options['provider']);
		

// replace n in format string with number, stripping initial 0
(provided in format)

//the $options['mobile'] in your form should be your mobile number
with the countrycode - ie mine is +44 then without 0
		
$provider_data[0]=str_replace('n',ltrim($options['mobile'],0),$provider_data[0]);

$to=$provider_data[0] . '@' . $provider_data[1];

$header=$options['header'];

$emailheaders = 'From: geneva@xxxxxxxxxxxxx' . "\r\n" .
'Reply-To: geneva@xxxxxxxxxxxxx' . "\r\n" .
'X-mailer: PHP/' . phpversion();

global $userdata;
get_currentuserinfo();
		
$subject="Text from theGeneva.com";
$message= strip_tags(stripslashes($_POST['sms-message']));


//Trim message to max SMS number	
$message=substr($message,0,$options['maxlength']);  

@mail($to, $subject, $message, $emailheaders);

				

</code>


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux