Email to sms script

SpaceshipSpaceship
Watch

broad_line

Established Member
Impact
0
hi guys Plz help me!! I need a script to send sms. actually i have a gateway email address and i'm able to send sms from mail and now plan to make web form for sms. but i'm not so good in php so plz how to make web form and php processing... plz post here..

i need like this [email protected]

thanks
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
I'm a bit busy atm, So I will make you a quick script like:
index.php?number=08024368736&message=hi mate

PHP:
<?php
if(strlen($_GET['number']) == 12 && is_numeric($_GET['number'])) {
if(isset($_GET['message'])) {
$to = $_GET['number'].'@smsgatewayemail.com';
$subject = 'none';
$message = htmlentities($_GET['message']);
mail($to, $subject, $message);
echo 'Sent!';
} else {
echo 'No message.';
die();
} else {
echo 'Invalid mobile number';
die();
}
?>

Hope it works, I would love rep :p
 
0
•••
Here's a form too... Might've typo'd...

PHP:
<?php
// Danltn - Derived from Xyzer
if(strlen($_POST['number']) == 12 && is_numeric($_POST['number'])) {
if(isset($_POST['message'])) {
$to = $_POST['number'].'@smsgatewayemail.com';
$subject = 'none';
$message = htmlentities($_POST['message']);
mail($to, $subject, $message);
echo 'Sent!';
} else {
echo 'No message.';
die();
} else {
echo 'Invalid mobile number';
die();
}
} else { ?>
<form action="form.php" method="POST">
<input type="text" name="number" style="width:50%;" />
<textarea style="padding-left:0px; margin-left:0px; width:100%;height:80%" name="message">
<input type="submit" value="submit />
</form>
<?php } ?>
 
0
•••
thanks friend
but i'm facing like this error
Parse error: syntax error, unexpected T_ELSE in /home/cocaine/public_html/sms.php on line 12

what to do plz help me..!!
thanks again
 
0
•••
0
•••
Xyzer's code was... odd. Decided to rip the 2nd part of it apart... Here:

PHP:
  <?php
// Danltn - Derived from Xyzer
if(strlen($_POST['number']) == 12 && is_numeric($_POST['number'])) {
if(isset($_POST['message'])) {
$to = $_POST['number'].'@smsgatewayemail.com';
$subject = 'none';
$message = htmlentities($_POST['message']);
mail($to, $subject, $message);
echo 'Sent! to ' . $to;
} } else { ?>
<form action="email.php" method="POST">
<input type="text" name="number" style="width:50%;" />
<textarea style="padding-left:0px; margin-left:0px; width:100%;height:80%" name="message"></textarea>
<input type="submit" value="submit />
</form>
<?php } ?>
 
0
•••
Dynadot — .com TransferDynadot — .com Transfer
CatchedCatched

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
NameMaxi - Your Domain Has Buyers
DomDB
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back