Anonymous
Anonymous asked in 電腦與網際網路程式設計 · 2 decades ago

如何寫有傳送簡訊功能的網站(20點)

如何寫有傳送簡訊功能的網站?如yahoo的http://tw.mobile.yahoo.com/texts/sms.php?

其中要用到那些特別的技術?

3 Answers

Rating
  • Anonymous
    2 decades ago
    Favorite Answer

    有現成的Interface只要你有那家公司會員帳號即可:

    這邊提供 PHS (大眾)、emome (中華電信)、HiNet ADSL (中華電信)、PChome (電腦家庭) 所提供的簡訊介面的 Perl code 讓大家用,其中我自己平常有在跑的是 emome 及 PChome 兩個,其他的我就不清楚了…

    這是 HiNet ADSL 的 code:

    #!/usr/bin/perl

    use WWW::Mechanize;

    use strict;

    &sendsms(\"HN 號碼\", \"密碼\", \"0911341234\", \"簡訊測試\");

    sub sendsms

    {

    my ($username, $password, $receiver, $msg) = @_;

    my $number = 0;

    my $agent = WWW::Mechanize->new();

    $agent->get(\"http://hiair.hinet.net/hweb/hiairpost_new.jsp/%22)...

    $agent->form(\"form1\");

    foreach (split(/[ ,]+/, $receiver))

    {

    $agent->field(\"tel\", $_, ++$number);

    }

    $agent->field(\"add_name\", \"0\");

    $agent->field(\"message\", $msg);

    $agent->submit();

    $agent->form(\"loginform\");

    $agent->submit();

    $agent->form(\"AuthScreen\");

    $agent->field(\"aa-uid\", $username);

    $agent->field(\"aa-passwd\", $password);

    $agent->submit();

    foreach (split(/\r|\n/, $agent->content()))

    {

    next unless (/window.location.href='/i);

    $_ =~ /window.location.href='(.+)'/i;

    my $newurl = $1;

    $agent->get($newurl);

    last;

    }

    print($agent->content());

    }

    這是 PChome 的 code:

    #!/usr/bin/perl

    use HTML::Form;

    use WWW::Mechanize;

    use strict;

    &sendsms('username', 'password', 'confirm code', '0911341234', '測試簡訊');

    sub sendsms

    {

    my ($username, $password1, $password2, $receiver, $msg) = @_;

    my $agent = WWW::Mechanize->new();

    $agent->agent_alias('Windows IE 6');

    $agent->get('http://sms.pchome.com.tw/front_end/sms');

    $agent->form_number(1);

    $agent->field('fuid', $username);

    $agent->field('pwd', $password1);

    $agent->submit();

    $agent->form_number(2);

    $agent->field('InputMsg', $msg);

    my $num = 0;

    foreach my $phone_number (split(/,+/, $receiver))

    {

    $agent->field(sprintf('mobile%02d', ++$num), $phone_number);

    }

    $agent->submit();

    $agent->field('auth_code', $password2);

    $agent->current_form()->action('https://ezpay.pchome.com.tw/auth_form_do');

    $agent->submit();

    }

    再來是 PHS 的 code:

    #!/usr/bin/perl

    use WWW::Mechanize;

    use strict;

    &sendsms(\"0968123123\", \"A123456789\", \"0968123123\", \"PHS SMS test\");

    sub sendsms

    {

    my (%h);

    my ($username, $password, $receiver, $msg) = @_;

    my $agent = WWW::Mechanize->new();

    $agent->agent_alias('Windows IE 6');

    $agent->get('http://www.phs.com.tw/myphs/Login.asp?URL=Send-SMS...

    $agent->form('form1');

    $agent->field('PhoneNo', $username);

    $agent->field('PWD', $password);

    my $con = $agent->submit();

    $agent->get('Send-SMS.asp');

    $agent->form('frmSS');

    $agent->field(\"txtSMS\", $msg);

    $agent->field(\"RcvPhoneNo1\", $receiver);

    $agent->field(\"rdSendTime\", \"R\");

    $con = $agent->submit();

    }

    最後是 emome:

    #!/usr/bin/perl

    use HTML::Form;

    use WWW::Mechanize;

    use strict;

    &sendsms('0911341234', '123456', '0911341234', '我是 dk,來打 settler 或 war3 吧');

    sub sendsms

    {

    my ($username, $password, $receiver, $msg) = @_;

    my $agent = WWW::Mechanize->new();

    $agent->agent_alias('Windows IE 6');

    $agent->get('http://www.emome.net/cgi-bin/MASP/jsp/membersvc/Au...

    $agent->form('myform');

    $agent->field('MSISDN', $username);

    $agent->field('PASSWD', $password);

    $agent->submit();

    $agent->form('form1');

    $agent->field('phonelist', $receiver);

    $agent->field('data', $msg);

    $agent->field('language', 2); # 1 == 中,2 == 英

    $agent->current_form()->action('http://websms1.emome.net/sms/sendsms/send.jsp');

    $agent->submit();

    }

    Source(s): google
  • 2 decades ago

    通常要跟電信業者或者簡訊提供商來簽約購買簡訊收發的使用權,看你網頁要怎寫,再配合他們所需傳送到伺服端的參數(利用ASP、PHP或者其他CODE來傳輸所需要的目的地號碼、簡訊內容、帳號密碼等資料),才有辦法發送唷~^_^

  • Anonymous
    2 decades ago

    網頁本身是用PHP程式語言所寫..

    簡訊功能需要配合電信業者支援.. 一般使用者應該沒辦法自己完成~

    *除非你對電訊程式的技術很專門.. 可以自己破解這種東西。

    Source(s):
Still have questions? Get your answers by asking now.