Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Launching an application from CGI

Status
Not open for further replies.

nogs

Technical User
Aug 3, 2001
89
GB
I have a CGI script which enables SMS messaging from a webpage. I select a name from an addressbook enter text to send and submit it.
The captured output works fine from the command prompt , the CGI script wont send SMS its own.

Can anybody help please!!!!!!
 
give us a look at a concise piece of your code

What OS?
What web server?
Any other pertenant info?

If you are new to Tek-Tips, please use descriptive titles, check the FAQs,
and beware the evil typo.
 
Reply to goBoating;
SCO
Apache
#!/appl/bin/perl
use CGI;
use IO;
$query = new CGI;
print $query->header,
start_html("Web Pager Gateway"),
h1("Web Pager Gateway"),
hr();
unless ($query->param) {
&getnums;
print $query->start_form( -name=>"Input");
print "Enter your message here:";
print $query->hr;
print $query->textarea( -name=>'message',
-rows=>2,
-columns=>80);

print $query->hr("Select the recipients (use the Control key to pick several)");
print $query->p;
print $query->scrolling_list(
-name=>'recipients',
-values =>\@vals,
-size=>8,
-multiple=>'true'
)
;
print $query->hr("Press this button to send");
print $query->p;
print $query->submit(-value=>'Send Message');
print $query->end_html;
}
else {
@names = $query->param;
$message = $query->param('message');
@recipients = $query->param('recipients');
$recipientlist = join(",",@recipients);
$recipientlist =~ s/ //go;
$output = '/usr/local/bin/sms_client ' .
$recipientlist .
" \"" .
$message .
"\" >&smsout";
system $output;
print "Message \"$message\" sent to: " ;
print $recipientlist;
print p;
#print &quot;<br><br>*&quot; . $output . &quot;*&quot;;
print $query->end_html;
}
sub getnums {
open SMSRC, '/usr/local/etc/sms/sms_addressbook;
while (<SMSRC>) {
next if /^#/;
next if /^SMS_default_service/;
($name,$num) = split(&quot;=&quot;);
chop $num;
$code{$name} = $num if $num;
}
@vals = keys %code;
}
 
Hi,

I copied your code above and pasted into my computer. Then ran it and got an error [Cannot find the string terminator any before the eof, line 51.

Take a look at line 51. I'm not sure this is your only problem, but it a start.

line 51 should be:

open SMSRC, '/usr/local/etc/sms/sms_addressbook';

Leland F. Jackson, CPA
Software - Master (TM)
Nothing Runs Like the Fox
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top