Fellow Monks,
I am writing a perl script using CGI.pm to allow add/edit/delete of positions available. Things seemed to be going well and I thought I was starting to understand this module a little. I was soon disappointed to learn that my understanding was less than stellar. I generate a html page with the following sub procedure:

sub PrintForm { &Open_File; &Read_File; &Close_File; print header( -type => 'text/html' ), start_html( -title => 'PMI Human Resources', -background=>'/yellow_stucco.gif'), start_form(-method => 'post', -action => 'editpositions.pl'), scrolling_list(-name=>'list_name', -values => \@JobTitle, -size => 1), br, br, submit(-name => 'Add', -value => 'Add Position'), br,br; if (@JobTitle) { print submit(-name => 'Edit', -value => 'Edit Position'), br,br, submit(-name => 'Delete', -value => 'Delete Position'), br,br, end_form; } print start_form(-method => 'post', -action => '../EditDeptInfo.p +l.bak'), hidden('Manager', 'Manager'), submit(-name => 'Cancel', -value => 'Cancel'), end_form, end_html;


The following section of code should take care of a user pressing the submit button named Add.

print header(-type => 'text/html\n\n'), start_html(-title => 'PMI Human Resources', -background=>'/yellow_stucco.gif'), start_form(-method => 'post', -action => 'editpositions.pl' ), "What is the Job Title?", textfield('JobTitle', '', 30, 80), br, br, "What is the Date Listed?", textfield( 'DateListed', '', 30, 80), br, br, "What is the Job Description?", textarea('Description', '', 10, 80), br, br, submit(-name => 'AddFile', -value=> 'AddFile'), end_form, start_form( -method => 'post', -action => 'editpositions.pl'), p, hidden('Manager', 'Manager'), submit(-name => 'submit', -value=> 'Cancel'), end_form, end_html; }

Now I am using -w and Use strict; in my code and have declared the proper scoped variables to make this work. The problem is that when a user hits the Add submit button, they get a file download popup window. It shouldn't. I may be missing something that is causing it, but my eyes are bleeding from staring at this code. Any help/insight would, as always, be appreciated.

Prince99

Too Much is never enough...

In reply to cgi improper file upload??? by Prince99

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.