Gossamer Forum
Home : Products : DBMan : Customization :

Adding a record

Quote Reply
Adding a record
Hello
When I add a new record I get a system 500 error, I check my error log and it tells me "Premature end of script headers:" I look at my script but don't see any thing worng. Maybe I need another set of eyes looking at it.

This is the part I'm having trouble with.

##########################################################
## Adding ##
##########################################################

sub html_add_form {
# --------------------------------------------------------
# The add form page where the user fills out all the details
# on the new record he would like to add. You should use
# &html_record_form to print out the form as it makes
# updating much easier. Feel free to edit &get_defaults
# to change the default values.

&html_print_headers;
print qq|
<html>
<head>
<title>$html_title: Add a New Record.</title>
</head>

<body bgcolor="#DDDDDD">
<form action="$db_script_url" method="POST">
<input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$db_uid">
<center>
<table border=1 bgcolor="#FFFFFF" cellpadding=5 cellspacing=3 width=500 align=center valign=top>
<tr><td colspan=2 bgcolor="navy">
<FONT FACE="MS Sans Serif, arial,helvetica" size=1 COLOR="#FFFFFF">
<b>$html_title: Add a New Record</b>
</td></tr>
<tr><td>
<p><center><$font_title><b>
Add a New Record
</b></font></center>

This database has been set up so you can add your additional insurance information. Please add any record necessary to your list. When you are finish Adding or Modifying your records and would like to proceed to the final step click "PAYMENT" below.
<$font>
|; &html_record_form (&get_defaults);
print qq|
</font></p>
<p><center> <INPUT TYPE="SUBMIT" NAME="add_record" VALUE="Add Record"> <INPUT TYPE="RESET" VALUE="Reset Form"></center></p>
|; &html_footer; print qq|
</td></tr>
</table>
</center>
</form>
</body>
</html>
|;
}

sub html_add_success {
# --------------------------------------------------------
# The page that is returned upon a successful addition to
# the database. You should use &get_record and &html_record
# to verify that the record was inserted properly and to make
# updating easier.

&html_print_headers;
print qq|
<html>
<head>
<title>$html_title: Record Added.</title>
</head>

<body bgcolor="#DDDDDD">
<center>
<table border=1 bgcolor="#FFFFFF" cellpadding=5 cellspacing=3 width=500 align=center valign=top>
<tr><td colspan=2 bgcolor="navy">
<FONT FACE="MS Sans Serif, arial,helvetica" size=1 COLOR="#FFFFFF">
<b>$html_title: Record Added</b>
</td></tr>
<tr><td>
<p><center><$font_title><b>
Record Added
</b></font></center>

<$font>
To add another insured press <A HREF="$db_script_link_url&add_form=1">Add</A> or when you are finish Adding all of your records and would like to proceed to the final step click here <A HREF="$db_script_link_url&logoff=1">"PAYMENT"</a> .
<P><Font face="Verdana, Arial, Helvetica" Size=2>The following insured was successfully added to the database:</FONT>
|; &html_record(&get_record($in{$db_key})); print qq|
</font></p>
|; &html_footer; print qq|
</td></tr>
</table>
</center>
</body>
</html>
|;
}


Am I missing something? this is the only part of the program that is not working correctly.

Thank you,

Quote Reply
Re: Adding a record In reply to
I don't see anything wrong either.

Is the record being added to the database?

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Adding a record In reply to
No, I guess the error happens somewhere after the form is filled out and the data is add to the db. Could this have anything to do with the program deleting the user password when loging off? That was the last thing change (but I don't think thats it).

Thank you,
Ed--

Quote Reply
Re: Adding a record In reply to
Try taking out the last code you added and see if that fixes it.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Adding a record In reply to
I did no luck :(

Quote Reply
Re: Adding a record In reply to
Then the problem was there before you added the last code.

If the record is not being added, you have a problem in your db.cgi file, probably in sub add_record. Have you made any changes in that subroutine?


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Adding a record In reply to
I did not make any changes to the "sub add_record" but while reviewing it I notice the line about the "counter" and what I found is:
My db already had 13673 records in it, all number from 52-13673, The customer has the option to add or modify their record, It was not till 2 weeks that someone "ADD" record number 52, the default.count was set at 52 when the cgi look at this and gave me the error 500. so I change my counter to 13674, then tried it 20-30 times and it work. (for now):)

Thank you for all of your help.

Ed--