rbspro has asked for the wisdom of the Perl Monks concerning the following question:

Hi There,

I Have this script whish should send info to me via email with the edited fields fulled in by the user, they should then get a email confirming this. But getting errors when uploaded to server the dreaded 500 Internal Server Error. When I look at this script in detail the errors seem to be coming from the 3rd line.

$mail_prog = '/usr/sbin/sendmail' -froot@willettsbutchers.co.uk; Warning: Content-Type header not found in the script output. Array found where operator expected at willettsform.cgi line 3, at end + of line Unquoted string "co" may clash with future reserved word at willettsfo +rm.cgi line 3. Unquoted string "uk" may clash with future reserved word at willettsfo +rm.cgi line 3. syntax error at willettsform.cgi line 3, near "froot@willettsbutchers" Execution of willettsform.cgi aborted due to compilation errors

Please can you help as I know nothing about scripting and have not got a clue what this means.

rbspro

Retitled by davido from 'snytax errors'.

Replies are listed 'Best First'.
Re: Tracking down the source of '500 server' errors
by dragonchild (Archbishop) on Feb 21, 2005 at 15:27 UTC
    Change that line to $mail_prog = '/usr/sbin/sendmail -froot@willettsbutchers.co.uk'; and you should be better. I moved the second apostrophe to right before the semi-colon.

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

      Nice one cheers dude it worked
Re: Tracking down the source of '500 server' errors
by gellyfish (Monsignor) on Feb 21, 2005 at 15:31 UTC

    If you haven't got a clue about 'scripting' you may be better off looking at a pre-made program that appears to do what you want - such as the NMS programs. Form to email programs are pretty easy to hack together quickly and also very easy to get get hopelessly wrong, make exploitable by spammers and crackers to distribute thousands of spam messages anonymously or compromise the security of your server.

    /J\

      Yeh i know it was created with one of those programs but they still need debugging
Re: Tracking down the source of '500 server' errors
by chas (Priest) on Feb 21, 2005 at 15:50 UTC
    If your script returns HTML, you need to have a line:
    print "Content-type: text/html\n\n";
    It looks like that may be another problem.
    (If you  use CGI qw/:standard/; then you can get this with  print header('text/html');)
    chas