Hello,

Please let me know if I am posting this in the wrong place.

I have a machine that is running Apache/1.3.26 (Unix) mod_perl/1.27 on Linux.

My Perl script handles form submissions and checks the environment variable CONTENT_TYPE via $ENV{'CONTENT_TYPE'} before parsing the information coming from the Web page. The script expects CONTENT_TYPE to be 'application/x-www-form-urlencoded'. Otherwise, the script halts with an error message.

This script has been working for years on many different machines including this one. But now, interimittently, on this machine, when the script checks the CONTENT_TYPE environment variable it finds it empty.

Unfortunately, I am not an administrator of the machine. Also, this installation of Apache supports a product called Blackboard, which appears to require that all URLs be redirected to themselves plus a ?batt=Y added to the end. The configuration is complicated, I'm sure and I don't understand it well.

I'm confident the problem lies either in the interaction between mod_perl and Apache or the configuration of the Apache Web server.

My questions are:

1. Under what circumstances can the CONTENT_TYPE environment variable be set to nothing when the script program is called from a Web page via something like

<FORM ACTION="http://myserver.edu/cgi-bin/myscript.pl" METHOD="POST"> ... </FORM>

2. Is it possible for aliasing or redirecting from Apache to cause the CONTENT_TYPE to be reset? It feels like a timing issue because half the time it works and the other half the CONTENT_TYPE environment variable is empty.

Any advice would be greatly appreciated.

Thank you in advance.

Richard


In reply to CONTENT_TYPE environment variable sometimes empty when posting a form? by rzward

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.