Message Board

   Importing Data File
   Into GoldMine
   Into Act



   Custom Programming

   PHP Version

Other Favorites

   Hire a clean comedian

   Bible Search Engine

   Bible in a Year

   Parallel Bible

   The Richer Life


[ Message Board Home ]    [ Post Reply ]    [ Log In ]    [ Sign Up ]

  Subject: Premature End of Script Error
  Posted: 07/21/2004 at 6:56:28 am
  By: LatterRain

Hello. This is the error message I keep getting when I try to submit my form information. I am on a public domain, my perl path is standard, my sendmail path is usr/sbin/sendmail. I put that into the correct line of code in the bizmail.cgi file. These are the hidden fields I have in the form:

<form action="http://www.febconline.com/cgi-bin/bizmail.cgi" method="POST" name="Subscribe">
<input type="hidden" name="subject" value="Information Request from WebSite">

<input type="hidden" name="sendreply" value="1">
<input type="hidden" name="reply_subject" value="RE: {firstname} {lastname}, your recent request">

<input type="hidden" name="send_to" value="1">
<input type="hidden" name="send_to" value="2">
<input type="hidden" name="cc_to" value="1">

<input type="hidden" name="email" value="">
<input type="hidden" name="success_page" value="http://www.febconline.com/cgi-bin/success.cgi?p=1&firstname={firstname}&lastname={lastname}">

<input type="hidden" name="required" value="firstname,lastname,adr1,city,state,zip,email,learnabout">
<input type="hidden" name="required_desc" value="First Name,Last Name,Address,City,State,Zip Code,Email,Learn About">

<input type="hidden" name="error_page" value="1">
<input type="hidden" name="data_format" value=",">
<input type="hidden" name="text_qualifier" value="1">
<input type="hidden" name="outputfile" value="fistname,middle_initial,lastname,email,ipaddress,date">

<input type="hidden" name="message_format" value="html">

Also, I set up and triple checked the " \ " character in the send_to and cc_to lines. The email is formatted correctly. I even put the " -w " in the success and bizmail cgi's. I have tried to chmod everything to 777 and to the settings laid out in the readme file. No luck so far.

I am running on a Linux based server. My host said I needed to set ALL files to 755, but the instructions say not to. I just noticed the javascript code in the zip file. What is up with that? Where does it go? Is it needed? I read nothing about the JavaScript in the readme file.

Anyway. Hope you get to this soon. Thank you!


  Subject: Re: Premature End of Script Error
  Posted: 07/21/2004 at 8:44:11 am
  By: LatterRain

I have played around with the permissions of all files. One time, setting them up as stated in the readme file. Next, I tried to CHMOD them all to 777, as suggested. Then I try to set them all up as 755. Nothing is working. I have checked AGAIN the $send_to and $cc_to lines. They are formatted correctly. This is the error I keep getting:

[Wed Jul 21 09:28:57 2004] [error] [client] Premature end of script headers: /home/virtual/site78/fst/var/www/cgi-bin/bizmail.cgi
failed to open log file
fopen: Permission denied
[Wed Jul 21 09:36:37 2004] [error] [client] Premature end of script headers: /home/virtual/site78/fst/var/www/cgi-bin/bizmail.cgi
failed to open log file
fopen: Permission denied
[Wed Jul 21 11:24:40 2004] [error] [client] Premature end of script headers: /home/virtual/site78/fst/var/www/cgi-bin/bizmail.cgi
failed to open log file
fopen: Permission denied
[Wed Jul 21 11:33:01 2004] [error] [client] Premature end of script headers: /home/virtual/site78/fst/var/www/cgi-bin/bizmail.cgi

Premature end of script headers...
With a fopen: Permission denied.

What is up, chuck?

Thank you for your time in this matter.

  Subject: Re: Premature End of Script Error
  Posted: 07/21/2004 at 12:55:38 pm
  By: Seth Knorr

Ok firstly.
You can only have ONE send_to hidden field in your form:
<input type="hidden" name="send_to" value="2">

2. All files should be set to 755, except YOUR datafile, and the MIME folder, as well as Lite.pm, Which is located inside the MIME folder. These files should be set to 777.

If 755 does not work, then try 777, however on some servers even 777 will not work, that is why 755 is your best bet at first.

it looks as if one of a couple things is wrong:
1. did your remember the \ before the @ sign when configuring the send to and cc to email address.
2. is the path to perl correct at the top of bizmail.cgi OR bizmail.pl
3. Did you upload the MIME folder to the cgi-bin and chmod the MIME folder and Lite.pm which is located in this folder to 777.
4. ARE YOU SURE the path to SMTP or SENDMAIL is correct?
These are the first basics, also have you changed the script in anyway other than what you are supposed to configure. Make sure you did not acidently delete any code.


  Subject: Re: Premature End of Script Error
  Posted: 07/21/2004 at 8:39:55 pm
  By: LatterRain

Still not working, Seth.

The path to perl is correct:


The path to sendmail is correct:


I took out the extra send to call in the form script. I have tried to take out the "www" in the form tag:

<form action="http://www.febconline.com/cgi-bin/bizmail.cgi" method="POST" name="Subscribe">

I have tried to CHMOD everything to 777, and everything except "bizmail.dat," "MIME folder," and the "Lite.pm" files to 755. I have tried to move the formerror (my html personalized version of the rror script) to the cgi-bin, and I have tried running the script with it in the folder with all my other site pages.


Please help.

I am STILL getting the "premature end of script headers" error in my log.

Thank you for your time

  Subject: Re: Premature End of Script Error
  Posted: 07/22/2004 at 5:50:58 am
  By: Seth Knorr

What type of server are you on?


  Subject: Re: Premature End of Script Error
  Posted: 07/22/2004 at 6:47:34 am
  By: LatterRain

I am on a Linux based server.

I got another message from my host that said they think that CHMODing to 777 is a security risk, for thier servers. They said there should be no need to set permissions for that and suggested AGAIN that I set EVERYTHING to 755. This as stated in the readme file is not possible. What I am going to try is to write out the entire url for all files needed for the script.

Such as $MY_error_page{"1"} = "http://www.febconline.com/formerror.html"

$datafile{"1"} = "http://www.febconline.com/cgi-bin/bizmail.dat"

I don't think it is neccessary I do this, but I am running out of ideas. I think the script is going to be a bust for me because of the settings for the server. "They don't allow/like 777 permissions."

grrrrr...and I was SO interested in using this script.

Is there ANY way around this problem?


  Subject: Re: Premature End of Script Error
  Posted: 07/23/2004 at 9:45:13 am
  By: Seth Knorr

Firstly: formerror.html needs to be uploaded to your cgi-bin.

Secondly: the config should look like this:

$MY_error_page{"1"} = "formerror.html";
$datafile{"1"} = "bizmail.dat";

However all files that are located in the cgi-bin FOLDER in the download zip file should be uploaded to the cgi-bin.

Also: Chmoding all files to 777 could create a security risk if they are CGI files. However CHMODING a data file to 777 is not a security risk. If they tell you it is; they are speaking hog wash!

WITH THAT SAID. Your problem you are having is not with the data file. You do not get an internal server error because the data file is not chmoded correctly. It is probably with the location of files, the script is trying to access but can not. Read over the readme.txt file and make sure you have everything placed correctly.


  Subject: Re: Premature End of Script Error
  Posted: 07/24/2004 at 9:14:51 am
  By: LatterRain

Well, my hosting company is going to switch me to a server of thiers that allows for 777 CHMODing.

The scripts are located in the right place. All files have the correct permissions. I didn't change the url's in the bizmail.cgi file. I have two questions.

1. In the form.html page, how do I call the "formerror.html" (my personalized error page)? As opposed to the default error page. What line of code do I use?

2. What in the world do I do with the JAVASCRIPT REQUIRED script in the zip file? There is nothing about that in the readme file. This is what I HAVE done:

I have inserted the script into both the form.html and the formerror.html pages. I even made sure all fields were labeled correctly.

I uploaded the script into the cgi-bin directory of my website. which is located at "/var/www/cgi-bin"

my website is located in "/var/www/html"

My perl is located in "#!usr/bin/perl"

My sendmail is located at "usr/sbin/sendmail"

There is an " \ " before the " @ " in all the email addresses in the bizmail.cgi file.

I have gone over and over the script. Nothing is working.

  Subject: Re: Premature End of Script Error
  Posted: 07/24/2004 at 9:32:13 am
  By: Seth Knorr

1. You have to read the readme file. read under "(1D) CONFIGURING Personalized Required Error Template Module (OPTIONAL)"
Just click
Edit -> Find
in notepad and then paste the text in the quotes in and start reading.
The formerror.html page is called by bizmail.cgi.
So upon an error it will look like you are at bizmail.cgi, however it will be pulling the content from formerror.html.

2. The javascript required file is simply from older versions where people have upgraded from. You do not need that file. Basicaly all it is, is code if you want to use javascript to make sure that required fields are filled in.


  Subject: Re: Premature End of Script Error
  Posted: 07/28/2004 at 10:57:51 am
  By: LatterRain

Seth, I would LOVE to thank you for a great script.

I changed servers with my hosting company to ones that allowed for 777 permissions. As soon as the new servers were up, I ran the script and it worked!

After some tweaking, I have the script running as smoothly as possible.

Here is the form:


The only thing I am having a problem with is the auto responders.

I can get {firstname} {lastname} to work, but when I try to install {email} in the email sent to the user, it doesn't show up.

It is a minor inconvinience, se I just got rid of the code all together.

Thanks for you time and patience during this frustrating time for me and you I am sure!


  Subject: Re: Premature End of Script Error
  Posted: 07/28/2004 at 11:07:56 am
  By: Seth Knorr

The problem with the email field is thus:
You have two email fields on your form:

The first is:
<input type=hidden name="email" value="">

The second is the field the form poster actualy fills in.

Get rid of the non-filled in hidden email field and you will be all set.

The problem being when it goes to personalize the message it will go by fields apearing first on the page. Since the hidden one is first, that is the one it uses to personalize.

I am glad you got it working,


  Subject: Re: Premature End of Script Error
  Posted: 07/28/2004 at 8:57:48 pm
  By: LatterRain

aaahhh ....

I will fix this problem tomorrow. <text>BLUSH</text>, there is one thing I have noticed that is wrong. Well, two if you want to be techincal.

The first one deals with the formerror page. When I fill out the form incorrectly, or miss a required field, I get sent to the formerror.html. It then shows the form and highlights the incorrect or missing information. What isn't cool is that it doesn't allow you to resubmit the document. Any thoughts? I am looking at this problem tomorrow too, but I wanted to run it by a professional.

The other problem is that I can't seem to run my .swf header on my success.html or my formerror.html pages. This is small fries compared to my first problem though, and I am positive that even that is not as big as I think it is.

Thanks again!


  Subject: Re: Premature End of Script Error
  Posted: 07/29/2004 at 5:57:42 am
  By: Seth Knorr

There are two reasons why you can not resubmit the form.

1. Then END </form> tag is directly after and below the opening <form> call on your formerror.html page.

<form method="POST" action="/cgi-bin/bizmail.cgi">

2. The END </form> tag needs to be placed below the submit button, as the only working elements of the form, will be from the begining opening <form> call to the end </form> call.

So basically the way you are calling the form, is simply to open, and the close right away with out using any of the fields.

On your .swf header.
1. This header can not be uploaded to your cgi-bin or it will not work. If you have not and have left it where it is then it is probably problem number two.

2. Remember that the error page is not located in your HTML folder, it is located in your cgi-bin, called by bizmail.cgi. So you will have to use the obsolute URL path to call the file.

So if it is in your home directory use "/file.swf"
or "http://www.mydomain.com/file.swf"

That should fix it for you.


Reply To This Topic

Due to unrelated post's, you must have an
account to post a message. To Sign Up click here.

Copyright 2000-2010 Seth M. Knorr,
BizMailForm.com Forms Processor, All Rights Reserved