|
ru.cgi.perl- RU.CGI.PERL ------------------------------------------------------------------ From : Andrei Protasovitski 2:5020/400 17 Aug 2004 10:05:43 To : Alexey Gradovtsev Subject : Re: Hа: модуль CGI -------------------------------------------------------------------------------- Доброго здоровья! Alexey Gradovtsev пишет: > AVG> с каких это щей параметры GET при GET+POST вдруг потеряются? > Это вопрос или утверждение? > А что у тебя выдает броузер после нажатия кнопки? > === > #!/usr/bin/perl > > use CGI qw(:cgi); > use Data::Dumper; > > print "Content-type: text/html\n\n"; > > print Dumper(param); > > print <<END; > <form method="post" action="test.pl?var1=val1&var2=val2"> > <input type="hidden" name="var3" value="val3"> > <input type="hidden" name="var4" value="val4"> > <input type="submit"> > </form> > END > === Специально для тех, кто ленится читать документацию: [-=cut=-] MIXING POST AND URL PARAMETERS $color = $query->url_param('color'); It is possible for a script to receive CGI parameters in the URL as well as in the fill-out form by creating a form that POSTs to a URL containing a query string (a ``?'' mark followed by arguments). The param() method will always return the contents of the POSTed fill-out form, ignoring the URL's query string. To retrieve URL parameters, call the url_param() method. Use it in the same way as param(). The main difference is that it allows you to read the parameters, but not set them. Under no circumstances will the contents of the URL query string interfere with similarly-named CGI parameters in POSTed forms. If you try to mix a URL query string with a form submitted with the GET method, the results will not be what you expect. [-=cut=-] А для особо ленивых могу сделать перевод по первому требованию. -- Andrei Protasovitski mailto:andrei()siliconmaterials.com JS "KamSil" http://www.siliconmaterials.com/ 137, Brestskaya str., ICQ: 75725244 225710, Pinsk, Belarus --- ifmail v.2.15dev5.3 * Origin: Protasonic (r) Soft (2:5020/400) Вернуться к списку тем, сортированных по:
Архивное /ru.cgi.perl/739466689094.html, оценка из 5, голосов 10
|