Hello, i'm starting now to write CGI and i'm also a perl newbie so...
i made a html form:
<form>action="http://argo.linux.sys/~nathanvi/cgi-bin/distro.pl" metho +d="POST"> Quale e' il tuo nome e cognome?<input type="text" name="nome" size="60 +" maxlength="59"> <br> Come hai conosciuto linux?<textarea name="conosciuto" rows="10" cols=" +40"></textarea><br> Quale distro usi?<br> <select name="distro" size="3"> <option value="mdk" label="mandrake">Mandrake</option> <option value="debian" label="debian">Debian</option> <option value="slack" label="slackware">Slackware</option> </select><br> <input name="Spedisci" value="Invia" type="submit"> </form>
and i wrote a cgi which can write the name of the user... The code is:
#!/usr/bin/perl use strict; my @campi; print "Content-type:text/html\n\n"; print "<html><head><title>Distribuzione usata</title></head>\n"; print "<body>\n"; @campi = split(/\&/,$ENV{'QUERY_STRING'}); print "Il tuo nome e cognome e': $campi[0] <br>"; print "</body>\n"; print "</html>\n";
When i press the post buttom it doesn't give me an error but it doesn't print the variable $campi[0].
Any suggestions?

-­--
os: Linux Mandrake 9.0
perl: obtained with OS


In reply to Very little CGI by nathanvit

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.