Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Programming

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-05-2003, 09:07 AM
Novice Webmaster
 
Join Date: Jul 2002
Location: KL
Posts: 40
Rep Power: 0
zumaidi is on a distinguished road
sms script

this script only works for 012 and 019. you can see how it works at http://kebunpakwa.netfirms.com.

this script uses a part of MOJO mailing list script located at http://mojo.skazat.com. so, please install this script and make sure it is working before using the sms script.

content of the perl file ( eg. sms.cgi ) which located in the same folder with mojo files:

Code:
#!/usr/bin/perl -w
use CGI::Carp "fatalsToBrowser"; 
use lib './'; #look for the MOJO folder in the same directory as the script
use lib './MOJO';
$ENV{PATH} = "/bin:/usr/bin"; 
use MOJO::CONFIG; 
use MOJO::GUTS;               
use MOJO::HTML;               
use CGI qw(:standard :html3);        
use strict;
$|++; 
my $q = new CGI;  
my $flavor          = $q->param('flavor'); 
   $flavor          = $q->param('f') unless($flavor); 
   
my $smsaddress = $q->param('smsaddress');
my $nombor = $q->param('nombor');
my $operator = $q->param('operator');
my $nama = $q->param('nama');
my $mesej = $q->param('mesej');
my @inlines = ();



my %Mode = ( 
'default'            =>    \&default,         		#user    start page with all lists
'sms'                =>    \&sms,                       #user    send sms
); 




if(exists($Mode{$flavor})) { 
	$Mode{$flavor}->();  #call the correct subroutine 
}else{
	&default
}
                                                                    
sub default { 


print header(); 
print('default');
exit;
}

sub sms {

print(admin_html_header(
      -Title => "SMS"
));

my ($sec, $min, $hour, $day, $month, $year) = (localtime)[0,1,2,3,4,5];
if ($operator eq "012") {$smsaddress = "6012".$nombor."\@sms.maxis.net.my"}
if ($operator eq "019") {$smsaddress = "019".$nombor."\@sms.celcom.com.my";}
$mesej = $mesej."free sms at http://www.yoursite.com";

require MOJO::MAIL;  
my $mh = MOJO::MAIL -> new(); 
my %mailing = (
 From           => "\"$nama\"<$sec\@yoursite.com>", 
'Return-Path'   => "\"yoursite\"<$sec\@yoursite.com>", 
'Errors-To'     => "\"yoursite\"<$sec\@yoursite.com>",
'Content-Type'  => "text/plain; charset=iso-8859-1",
List            => "no list",
To              => "$smsaddress", 
Subject         => "SMS dari $nama", 
Body            => "$mesej",
send_via_smtp   => "0",
'Strip-Headers' => "0"); 

$mh -> send(%mailing); 

print "sms sent";
print(admin_html_footer());
exit;
}
the content of the html form:
Code:
<html>
<head>
	<title>SMS</title>
<SCRIPT language=JavaScript>
<!--
function countMsg(theForm) {
	textMsg = theForm.mesej;
	textCount = textMsg.value.length;
	if (textCount > 120)  {
  		textMsg.value = textMsg.value.substring(0,120);
		textCount = 120;
  		}
	theForm.char_count.value = textCount
	}
//-->
</SCRIPT>
</head>
<body>
 <FORM action=http://www.yoursite.com/cgi-bin/mojo/sms.cgi method=post>
 <P>To: <SELECT name=operator size=1><OPTION selected 
        value=019>019</OPTION> <OPTION 
        value=012>012</OPTION></SELECT> <INPUT maxLength=8 name=nombor size=8> 
      <P>The SMS message:<BR><TEXTAREA cols=15 name=mesej onkeyup=countMsg(this.form) rows=6 wrap=virtual></TEXTAREA><BR><FONT 
      class=small size=-1>Total: <INPUT disabled name=char_count size=3 value=0> 
      chars. [Max:120]<BR><BR>Nama anda : <INPUT maxLength=8 name=nama size=8> <BR>
<font face=arial size=1>
<input type=hidden name=flavor value=sms>
<center> 

            <INPUT name=list type=hidden value=name_of_mojolist> <INPUT type=submit value=Submit>  <INPUT type=reset value=Reset> </center> </FORM></font>
</body>
</html>
that's all.
good luck.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-05-2003, 11:50 AM
ksstudio's Avatar
Administrator
 
Join Date: Jun 2001
Location: Malaysia
Posts: 334
Rep Power: 10
ksstudio has much to be proud of ksstudio has much to be proud of ksstudio has much to be proud of ksstudio has much to be proud of ksstudio has much to be proud of ksstudio has much to be proud of ksstudio has much to be proud of ksstudio has much to be proud of
Syabas zumaidi! and thank you for sharing out your SMS script.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 25-04-2004, 07:06 PM
BasicCX's Avatar
Inspired Webmaster
 
Join Date: Apr 2004
Location: Cheras, Selangor.
Posts: 104
Rep Power: 59
BasicCX is on a distinguished road
Send a message via Yahoo to BasicCX
Hahaha.......susahnyer script ko! aku dah buat dah script aku sendiri dengan usaha aku mencari maklumat sebelum ni. Aku punya kod lagi ringkas!

Walau apapun syabas kerana berjaya buat!
__________________
Check out: http://www.xpodonline.com
Hosting & Domain: http://www.cubiex.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 30-04-2004, 05:17 PM
Novice Webmaster
 
Join Date: Jul 2002
Location: KL
Posts: 40
Rep Power: 0
zumaidi is on a distinguished road
sepatutnya memang ringkas sebab ia macam buat formail. cuma, masa tu saya tak pandai nak setkan mail tersebut sebagai plain text.

anyway, boleh ke kongsi kod awak ?
btw, tahu tak macam mana nak setkan email return path utk cpanel ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-05-2004, 12:08 PM
crypdude's Avatar
New kid on the block
 
Join Date: Apr 2004
Location: England
Posts: 5
Rep Power: 0
crypdude is on a distinguished road
Send a message via Yahoo to crypdude
As'kum... camner kalau guna localhost, still leh guna gak ker code ni, kurang arif la..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 05-05-2004, 12:49 PM
Novice Webmaster
 
Join Date: Jul 2002
Location: KL
Posts: 40
Rep Power: 0
zumaidi is on a distinguished road
localhost ? saya tak faham...
kalau nak sms pakai PC sendiri, pakai aje Outlook express.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 13-05-2004, 01:58 AM
hymns's Avatar
Senior Webmaster
 
Join Date: Nov 2001
Location: Johor
Posts: 769
Rep Power: 101
hymns is on a distinguished road
Send a message via ICQ to hymns Send a message via Yahoo to hymns
dah ade mail server ke kat localhost?
__________________
I hate when:

vBulletin Message:
Sorry! The administrator has specified that users can only post one message every 60 seconds
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 08-02-2006, 08:06 AM
vincevincevince's Avatar
Digital Dream Broker
 
Join Date: Feb 2006
Location: Kuala Lumpur
Posts: 483
Rep Power: 0
vincevincevince can only hope to improve
Send a message via ICQ to vincevincevince Send a message via MSN to vincevincevince Send a message via Skype™ to vincevincevince
It's sending it via email gateway?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 25-06-2006, 09:33 PM
BasicCX's Avatar
Inspired Webmaster
 
Join Date: Apr 2004
Location: Cheras, Selangor.
Posts: 104
Rep Power: 59
BasicCX is on a distinguished road
Send a message via Yahoo to BasicCX
maner leh guna localhost!

For: vincevincevince
It's send via normal email function. SMTP n sendmail
__________________
Check out: http://www.xpodonline.com
Hosting & Domain: http://www.cubiex.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 22-02-2007, 03:30 PM
Novice Webmaster
 
Join Date: Oct 2006
Location: Butterworth
Posts: 10
Rep Power: 0
GTtan is on a distinguished road
Question

Hello,

May i know what to download from the page - mojo.skazat.com - then only the script can work? the *cgi file and sms.html file already ready. but i think less something so it comes out error. Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 23-02-2007, 08:48 AM
Novice Webmaster
 
Join Date: Jul 2002
Location: KL
Posts: 40
Rep Power: 0
zumaidi is on a distinguished road
as far as i know, sorry to say that celcom, maxis & digi are no longer offering sms service via 3rd party website. so, the script is no longer applicable. i have disabled sms utility at my kebunpakwa.netfirms.com for 2 years already.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for MLM Php script masrule Website Programming 0 24-01-2007 01:56 PM
script nurulmajdi Website Programming 12 16-02-2004 04:03 PM
Help Me With My First Php Script !!!! mya Website Programming 17 24-01-2004 06:12 PM
my script can't run..why? therion Website Programming 7 23-10-2003 05:14 PM
cgi script Seman Website Programming 6 16-09-2003 05:46 PM


All times are GMT +8. The time now is 03:22 AM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61