Need help with SMS script...


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need help with SMS script...
# 1  
Old 08-30-2010
Need help with SMS script...

I use the SMS script on this page:
http://www.prescriptionpc.com/TEST_n...ml#section=sms

The “functions” work fine, but after clicking “submit” and receiving the
“thank you” message, nothing happens.

I find it odd that I can send a text message to myself choosing my carrier (Virgin Mobile),
but if someone else selects another carrier, nothing happens.

=================================================================

I use the following php form to process the form:
Code:
 
<?php
/*
Credits: Bit Repository
URL: http://www.bitrepository.com/
*/
 
include 'smssender.php';
 
error_reporting (E_ALL ^ E_NOTICE);
 
$post = (!empty($_POST)) ? true : false;
 
if($post)
{
 
$from = $_POST['from'];
$to = $_POST['to'];
$carrier = $_POST['carrier'];
$message = stripslashes($_POST['message']);
 
 
$error = '';
 
// Check name
 
if(!$from)
{
$error .= 'Please Enter Your Number.<br />';
}
 
 
// Check message (length)
 
if(!$message || strlen($message) < 15)
{
$error .= "Your message should have at least 15 characters.<br />";
}
 
 
if(!$error)
{
$mail = mail($formatted_number, "TXT Message", $message, $headers);
 
 
if($mail)
{
echo 'OK';
}
 
}
else
{
echo '<div class="notification_error">'.$error.'</div>';
}
 
}
?>

=========================================================

I’ve added the INCLUDE function to include the following file:
Code:
<?php
$from = $_POST['from'];
$to = $_POST['to'];
$carrier = $_POST['carrier'];
$message = stripslashes($_POST['message']);
 
if ($carrier == "verizon") {
$formatted_number = $to."@vtext.com";
mail("$formatted_number", " TXT Message", "$message" , "$headers");
 
}
 
else if ($carrier == "tmobile") {
$formatted_number = $to."@tomomail.net";
mail("$formatted_number", " TXT Message", "$message" , "$headers");
 
}
 
else if ($carrier == "sprint") {
$formatted_number = $to."@messaging.sprintpcs.com";
mail("$formatted_number", " TXT Message", "$message" , "$headers");
 
}
 
else if ($carrier == "att") {
$formatted_number = $to."@txt.att.net";
mail("$formatted_number", " TXT Message", "$message" , "$headers");
 
}
 
else if ($carrier == "virgin") {
$formatted_number = $to."@vmobl.com";
mail("$formatted_number", " TXT Message", "$message" , "$headers");
 
}
 
?>

=========================================================

Is there ANY way of finding out where I went wrong in my code?

Thanks in advance,
Bruce

Last edited by pludi; 08-31-2010 at 02:15 AM.. Reason: code tags, please...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script that performs action when receiving an SMS.

My case is the following: -I have a Linux system where I have an smsd installed (SmsTools3) -This system works through a GSM module in which I can send and receive text messages. -Text messages arrive in a certain folder (/ var / spool / sms / incoming) -I need a script that does... (3 Replies)
Discussion started by: dMihawkCL
3 Replies

2. UNIX for Dummies Questions & Answers

Need to set up UNIX script to send sms on mobile

Hi All, Can anyone please help in setting up Unix script for sending text messages on mobile?? Actually scenario is we want notification when there is any failures in our processes or if any service goes down we must be notified by a text message on our mobile, we already have email... (3 Replies)
Discussion started by: NikhilM
3 Replies

3. Shell Programming and Scripting

Need shell script for SMS via telnet command

I am not very much familiar with telnet based scripting so I would need your help to directly submitting sms as deliver_sm or submit_sm msg to SMSC (IP & system_id and password are already known). So, need your help to provide such script. I previously used such script but my harddisk crashed and... (1 Reply)
Discussion started by: wasay
1 Replies

4. Shell Programming and Scripting

Sending sms through Shell script

Can anyone please help me to in scripting of sending sms through shell script (1 Reply)
Discussion started by: gargidas15
1 Replies

5. Shell Programming and Scripting

Bash script to send SMS

Hey guys I was wondering how to go about creating a bash script to send SMS..any ideas are appreciated.. (2 Replies)
Discussion started by: blackzeus
2 Replies

6. Solaris

Help with SMS sending Script

I would like assistance on a script that could send a text message to my mobile phone when I run a command and the text should be send only if a condition is met. I want to have a cron-job running every 10 minutes to check the system for overload conditons with a command: more logfile.log | grep... (5 Replies)
Discussion started by: thinktank
5 Replies

7. Shell Programming and Scripting

Need help on setting up New shell script for sending SMS

Hello guys, I have been given a task to set up a new shell script, which needs to trigger the SMS(Short Messaging Service) to the phone numbers if an event occurs like filesystem goes beyond the threshold value of 70%. I am having the script to send a mail to recipients if that incident happens... (3 Replies)
Discussion started by: vpraveenn
3 Replies

8. HP-UX

sending sms through shell script

pl. if any one can help me in this . i wouldlike to know if there is a way to send sms through unix box. i have tried using mailx option. but what type of servers will be required . if any one can give me references... Thankxs in advance Regards, Alpa (1 Reply)
Discussion started by: alpareshamwala
1 Replies

9. Shell Programming and Scripting

Sending SMS Via Unix Script?

Hi, Is it possible to send sms to a mobile from unix box using Shell Scripting? I really wonder if anyone can help me with some information regarding how to setup the environment if possible. Iam also searching and trying to setup the same. My Environment: HP-UX B.11.11 U 9000/800... (2 Replies)
Discussion started by: Omkumar
2 Replies

10. UNIX for Advanced & Expert Users

Unix shell Script To Send SMS

hi , can anyone help with a script to send SMS to some mobile numbers on some conditions. (1 Reply)
Discussion started by: sdcoms
1 Replies
Login or Register to Ask a Question