this simple assignment set link tags 5 english words: hello, good-bye, love, cat, , dog. each href completed linking spanish.pl file , passing spanish equivalents each word: hola, adios, amor, gato, , perro.
the following code spanish.html:
<p><a href="cgi-bin/spanish.pl?english=hello&spanish=hola">hello</a></p> <p><a href="cgi-bin/spanish.pl?english=good-bye&spanish=adios">good-bye</a></p> <p><a href="cgi-bin/spanish.pl?english=love&spanish=amor">love</a></p> <p><a href="cgi-bin/spanish.pl?english=cat&spanish=gato">cat</a></p> <p><a href="cgi-bin/spanish.pl?english=dog&spanish=perro">dog</a></p>
this spanish.pl:
print "the spanish word ", param('english'), " ", param('spanish') "\n";
i'm not familiar perl yet, i'm not sure do. when click on link english word downloads perl file. how display spanish word in browser?
also, should simple or similar when doing same exact assignment in asp , php? i'm not sure should like...
i have in php file, not sure if correct:
the spanish word <?php echo $_post["english"]; ?> <?php echo $_post["spanish"]; ?>.
i need fixing code , understanding how display properly.
thank you.
<p><a href="cgi-bin/spanish.pl?english=hello&spanish=hola">hello</a></p>
validate. validate. validate. should &
print "the spanish word ", param('english'), " ", param('spanish') "\n";
if being output html document, have xss problem.
when click on link english word downloads perl file.
you need to:
- pick api communicating between web server , perl program.
- ensure perl program conforms api
- configure web server execute perl program given url (the specifics of depend on web server using)
also, should simple or similar when doing same exact assignment in asp , php?
once configured, asp , php make assumptions want (such "you want output html document") don't writing cgi scratch (where have explicitly send content-type headers, instance).
the spanish word <?php echo $_post["english"]; ?> <?php echo $_post["spanish"]; ?>.
links make requests, not post requests.
Comments
Post a Comment