отправка SMS через WEB форму



Добрый всем день. Проблема такова. Пытался научиться отправлять SMS через Email=>SMS шлюзы пробовал, и еще какие-то уже не помню. У меня кривой МТС 902 сообщения не доходят. Если посылать через WEB - форму доходит со всех мгновенно. Вопрос: как научиться заполнять поля у этой формы и отсылать обратно, мне необходимо отсылать сообщения в терминальном режиме без Х-ов (init 3) .


Re: Apache --> mod_rewrite --> пара вопросов

Пример из книги "Perl. Библиотека программиста (Perl Cookbook)"

20.2. Automating Form Submission Problem

You want to submit form values to a CGI script from your program.

If you're submitting form values using the GET method, create a URL and encode the form using the query_form method:

use LWP::Simple;
use URI::URL;

my $url = url('');
$url->query_form(module => 'DB_File', readme => 1);
$content = get($url);

If you're using the POST method, create your own user agent and encode the content appropriately:

use HTTP::Request::Common qw(POST);
use LWP::UserAgent;

$ua = LWP::UserAgent->new();
my $req = POST '',
[ module => 'DB_File', readme => 1 ];
$content = $ua->request($req)->as_string;


For simple operations, the procedural interface of the LWP::Simple module is sufficient. For fancier ones, the LWP::UserAgent module provides a virtual browser object, which you manipulate using method calls.

The format of a query string is:


In GET requests, this is encoded in the URL being requested:

Fields must still be properly escaped, so setting the arg form parameter to "this isn't <EASY>&<FUN>" would yield:

The query_form method called on a URL object correctly escapes the form values for you, or you could use the URI::Escape::uri_escape or CGI::escape_html functions on your own. In POST requests, the query string is the body of the HTTP document sent to the CGI script.

We can use the LWP::Simple module to submit data in a GET request, but there is no corresponding LWP::Simple interface for POST requests. Instead, the HTTP::Request::Common module's POST function conveniently creates a properly formatted request with everything properly escaped.

If you need to go through a proxy, construct your user agent and tell it to use a proxy this way:

$ua->proxy(['http', 'ftp'] => '');

That says that both HTTP and FTP requests through this user agent should be routed through the proxy on port 8081 at
See Also

The documentation for the CPAN modules LWP::Simple, LWP::UserAgent, HTTP::Request::Common, URI::Escape, and URI::URL; Recipe 20.1

jonatan ()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.