I have a script called a.cgi - which prints out a form which includes the normal submit and reset buttons at the end. The target for this form is b.cgi. To start with when the submit button was clicked b.cgi would take over and the form data was printed out ala html. But as a result of clicking the submit button i want to print out a text doc. THerefore i deleted print header(), start_html("some script"), and at the end end_html(), and replaced them with
print header(-type=>'text/plain'). But now when I click on submit the browser begins to download b.cgi instead of recieving the text as I expected. But if i just enter http://baz.perlmonk.org/cgi-bin/b.cgi into the address window the script acts as i expected - outputing text in the browser window. THerefore the problem is only happening when the submit button calls b.cgi and when b.cgi prints in text context instead of html, another difference is that hitting submit posts to b.cgi. Whats going on, anyone?
Below is the piece of code used to call b.cgi( a.cgi and b.cgi are in the same directory)
print startform(-action=>'b.cgi',-target=>'_top'),table(Tr(\@table_con
+t)),submit(-name=>'Submit'),reset(-name=>'Reset'),end_form;
...and everything worked perfect before i changed the header function etc, as outlined above.