|
Hi, I have three questions. Can you answer??? The first question is: What can I do to this work??? In a form, somebody submit a password ($password) and I want to encrypt it. How can I do it??? And how can I d-ecrypt??? Is like this??? $password = $FORM{'password'}; print "Your encrypt password is: ",crypt("$password","PA"),"\n"; My second question is: I want to do a download site (like CNET and ZDnet). Can you help me??? My script now is like this: #!/usr/bin/perl $id= $FORM{'id'}; open (DOWNLOADS, "downloads.txt"); @downtext = <DOWNLOADS>; close (DOWNLOADS); # I don't know if that line is ok. I want to go to the line $id, because each program has an individual line. @downtext($id) = $text; ($name, $version, $url, $details, $rating) = split (/\,/,$text); <<"EOF"; <HTML> <BODY> Here I'll build the html code. Must I have to write Content-type: text/html $name $version $url $details $rating </BODY> </HTML> EOF My last question is: It the script of downloads what's the code to appear one star or five star image or "not rated" text, like if $rating = 1 (one_star.gif) if $rating = 2 (two_stars.gif) ......etc.... and if =0 (write "not rated") Thanking in advance, Nuno Lopes P.S.: Is this script write or was unecessary line??? It's in Portuguese!!! (ficheiro=file) #!/usr/bin/perl read(STDIN, $values, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $values); foreach $set (@pairs) { ($name, $itemvalue) = split(/=/, $set); $itemvalue =~ tr/+/ /; $itemvalue =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $itemvalue =~ s/<!--(.|\n)*-->//g; $FORM{$name} = $itemvalue; } $email = $FORM{'email'}; $ficheiro = $FORM{'ficheiro'}; open(MAIL, "|/usr/bin/sendmail -oi -t") or die; print MAIL <<"END"; From: Apolo <nunoclaudi\@bigfoot.com> To: $email Subject: Ficheiro: $ficheiro Obrigado por utilizar o servi�o de download de ficheiros por e-mail. O ficheiro que pediu encontra-se em attach. Ficheiro em attach: $ficheiro A equipa do Apolo END open(FILE, "uuencode $ficheiro $ficheiro|") or die Ficheiro inexistente. Corrija, se faz favor; while( <FILE>) { print MAIL; }; close(FILE); close(MAIL); <<"EOT"; <HTML> <HEAD> <TITLE>Ficheiro enviado com sucesso</TITLE> </HEAD> <BODY> <p>O ficheiro $FORM{'ficheiro'} foi enviado com sucesso para o e-mail $FORM{'email'}. </BODY> </HTML> EOT; |
