cgi aporia
Maistrelis Kostas
fm94 at freemail.gr
Sun May 24 16:29:03 EEST 1998
>To problhma einai pws an kapoios dwsei mesa sth forma kapoio xarakthra pera
>apo ta [A-Za-z0-9] sto cgi emfanizontai me kwdikous tou stul %F1 %E4 k.l.p
>
>Gnwrizei kaneis giati ginetai auth h metatroph kai pws ginetai na 3eperastei?
>
afto simvenei giati oi metavlites pou pernas sto cgi script prota pernane apo
url enconding gia ma mporei na metaferonte meso http..
ousiastika metatreponte se 16dika antistixa ton simvolon poy dineis..
i anapodi diadikasia legete unescaping..
kai 8elei kapio scriptaki na tin iloopoiei..
pare ena scriptaki se perl...
pantos kalo ine an asxolise me afta na ftiaxnis scriptakia se perl
tcl i kai c. opou iparxon etimes vivlio8ikes gia aftes tis doulies..
opos px to cgi.pm gia perl..
PERL SCRIPT
--------------------------------------------------------------------
if ($ENV{'REQUEST_METHOD'} eq "POST") {
read(STDIN,$buffer,$ENV{'CONTENT_LENGTH'});
} else {
$buffer = $ENV{'QUERY_STRING'};
}
# ============================================
# The @contents array will hold all FORM input
# ============================================
@pairs= split(/&/,$buffer);
foreach $pair (@pairs) {
($name,$value) = split(/=/,$pair); # split on equal signs
$value =~ tr/+/ /; # replace + by a space
# pack %HH into its ASCII equivalent for all instances.
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
$contents{$name} = $value;
}
# now you can get all the incoming values in the %contents associative array!
------------------------------------------------------------------------------
--
====================================================================
Gia boithia (h na diagrafhte) e-mail sto majordomo at argos.hol.gr
Ta archives tis listas einai sto http://www.argos.hol.gr/lists :
prin steilete kapoia erothsh psakte mipos exei hdh apanththei.
Gia opoiodipote problima stilte e-mail ston owner-linux-greek-users
====================================================================
More information about the Linux-greek-users
mailing list