Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2024-04-24 07:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found