OK, here's the situation: I have a perl script which basically takes the input of a form and dumps it to a file.

On my home machine, it works beautifully. Tested it on Apache.

On the server at work (Using IIS 4.0), it works pitifully. It records NO input from Netscape (all the variables are null) and in IE, all the data ends up in the same variable!

Here's the code.

#!C:/usr/bin/Perl use strict; use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser set_message); my $log = 'Requests.log'; #All three of these are dif +ferent in the actual script, but that's not the problem my $errors = 'Errors.log'; my $techcontact = 'me@myaddress.com'; #You don't seriously expect me to document what these variable +s contain, do you? my $_name = param( 'name' ); my $_email = param( 'email' ); my $_institution = param( 'institution' ); my $_rank = param( 'rank' ); my $_address = param( 'address'); my $_telnum = param( 'telnum' ); my $_faxnum = param( 'faxnum' ); open LOG, ">> $log" or die " I can't open logfile for append +ing: $! Contact $techcontact at once!"; print LOG "Name: $_name -- Email: $_email -- Institution: $_in +stitution -- Rank: $_rank -- Telnum: $_telnum -- Faxnum: $_faxnum -- +Address: $_address \n"; close LOG; #OK, so here's the problem: In IE, EVERY SINGLE field appears in $_nam +e #In Netscape, these are all blank! Help! What can I do?! print header; print "<HTML>"; print "<HEAD>\n"; print "<TITLE>Registration Received</TITLE>\n"; print "</HEAD>\n"; print "<BODY>\n"; print "<P>&nbsp;</P>\n"; print "<CENTER><H3>Your form has been received successfully.</H3 +><br>\n"; print "Expect a confirmation email with payment instructions in +the next few days."; print "</CENTER><P><P>We received the following information: "; print "<BR>Name: $_name"; print "<BR>Email: $_email"; print "<BR>Institution: $_institution"; print "<BR>Rank: $_rank"; print "<BR>Telephone: $_telnum"; print "<BR>Fax: $_faxnum"; print "<BR>Address: $_address"; print '<P>If this is wrong, try submitting again. If it is still + wrong, send the correct info to rvandenh@stfx.ca'; print "</BODY>\n"; print "</HTML>\n"; #This block of code deals with when the user needs to be smacked w +ith a clue-by-four. BEGIN { sub handle_errors { my $msg = shift; print "<B><I>$msg</I></B>"; print "<P>Try filling out the form again."; } set_message(\&handle_errors); }

In reply to Confounding CGI input problem by Anonymous Monk

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.