I have a few HTML forms that submit the collected info to a .cgi, which then sends the info on via sendmail. Everything was working fine until I switched hosting, and I started get 500 "premature end of script header" errors. After beating my head against the wall for a few days I discovered that my previous host's version of perl, sendmail, whatever, did not care if the HTML didn't have all the params the .cgi asked for - for example, if my HTML had
field1
field2
and my .cgi had
param("field1"
param("field2"
param("field3"
the script and sendmail worked with no errors. But I have several HTML forms that all point to the same .cgi file. The .cgi file asks for up to field20, and some of the HTML forms have only up to field13. Thus, I get the "premature end of script" error unless the form has up to field20. Do I have to write a separate script for each form on this host, or is there a line of code I can put in the .cgi script that will tell it to ignore if the field doesn't exist so I don't get that error? Maybe something that can be done with if exist()?
Thanks!
Steve
field1
field2
and my .cgi had
param("field1"
param("field2"
param("field3"
the script and sendmail worked with no errors. But I have several HTML forms that all point to the same .cgi file. The .cgi file asks for up to field20, and some of the HTML forms have only up to field13. Thus, I get the "premature end of script" error unless the form has up to field20. Do I have to write a separate script for each form on this host, or is there a line of code I can put in the .cgi script that will tell it to ignore if the field doesn't exist so I don't get that error? Maybe something that can be done with if exist()?
Thanks!
Steve