I have taken some code from YForm.cgi. This code was the appending to database feature. I included all necessary varaibles and functions. I created the formres.dat on the server and updated my html to set all variables for the database. I added this code to my ntformail.pl script. When I fill out the form everything runs smoothly but then when I go to download the .dat file to see the results, its still empty. Could this be because I might not have write permission to the direc and file? Wouldn't i get an error if I didn't. If you want I will send the script. Appreciate it all. Thanks.

If your on a Linux/Unix server set you permissions (on all files that have to be written to) to 777 and don't forget that the file folder that the file is in also has to be set to 777. But it is a better idea to set write able files to 777 and folders that contain write able files to 773 so that you can't view everything in the folder by typing something like http://yourdomain.com/filefolder.

# @referers allows forms to be located only on servers which are defined # # in this field. This security fix from the last version which allowed # # anyone on any server to use your FormMail script on their web site. #

# If the HTTP_REFERER was invalid, send back an error. # if ($check_referer != 1) { &error('bad_referer') } }

sub get_date {

# Define arrays for the day of the week and month of the year. # @days = ('Sunday','Monday','Tuesday','Wednesday', 'Thursday','Friday','Saturday'); @months = ('January','February','March','April','May','June','July', 'August','September','October','November','December');

# Get the current time and format the hour, minutes and seconds. Add # # 1900 to the year to get the full 4 digit year. # ($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(time))[0,1,2,3,4,5,6]; $time = sprintf("%02d:%02d:%02d",$hour,$min,$sec); $year += 1900;

# If they try to include server side includes, erase them, so they # aren't a security risk if the html gets returned. Another # security hole plugged up. $value =~ s/<!--(.|\n)*-->//g;

# If the field name has been specified in the %Config array, it will # # return a 1 for defined($Config{$name}}) and we should associate # # this value with the appropriate configuration variable. If this # # is not a configuration form field, put it into the associative # # array %Form, appending the value with a ', ' if there is already a # # value present. We also save the order of the form fields in the # # @Field_Order array so we can use this order for the generic sort. # if (defined($Config{$name})) { $Config{$name} = $value; } else { if ($Form{$name} && $value) { $Form{$name} = "$Form{$name}, $value"; } #BSS - Bug fix provided by JJ Steward: below line prevents print_blank_fields #from working correctly. - Added By Michael Bloomfield # elsif ($value) { else { push(@Field_Order,$name); $Form{$name} = $value; } } }

# The next six lines remove any extra spaces or new lines from the # # configuration variables, which may have been caused if your editor # # wraps lines after a certain length or if you used spaces between field # # names or environment variables. # $Config{'required'} =~ s/(\s+|\n)?,(\s+|\n)?/,/g; $Config{'required'} =~ s/(\s+)?\n+(\s+)?//g; $Config{'env_report'} =~ s/(\s+|\n)?,(\s+|\n)?/,/g; $Config{'env_report'} =~ s/(\s+)?\n+(\s+)?//g; $Config{'data_env_to_log'} =~ s/(\s+|\n)?,(\s+|\n)?/,/g; $Config{'data_env_to_log'} =~ s/(\s+)?\n+(\s+)?//g; $Config{'print_config'} =~ s/(\s+|\n)?,(\s+|\n)?/,/g; $Config{'print_config'} =~ s/(\s+)?\n+(\s+)?//g;

# For each require field defined in the form: # foreach $require (@Required) {

# If the required field is the email field, the syntax of the email # # address if checked to make sure it passes a valid syntax. # if ($require eq 'email' && !&check_email($Config{$require})) { push(@error,$require); }

# Otherwise, if the required field is a configuration field and it # # has no value or has been filled in with a space, send an error. # elsif (defined($Config{$require})) { if (!$Config{$require}) { push(@error,$require); } }

# If it is a regular form field which has not been filled in or # # filled in with a space, flag it as an error field. # elsif (!$Form{$require}) { push(@error,$require); } }

# If any error fields have been found, send error message to the user. # if (@error) { &error('missing_fields', @error) } }

sub return_html { # Local variables used in this subroutine initialized. # local($key,$sort_order,$sorted_field);

# If the field has a value or the print blank fields option # # is turned on, print out the form field and value. # if ($Config{'print_blank_fields'} &#0124; &#0124; $Form{$field}) { print "<b>$field:</b> $Form{$field}<p>\n"; } } }

# If a sort order is specified, sort the form fields based on that. # elsif ($Config{'sort'} =~ /^order:.*,.*/) {

# For each sorted field, if it has a value or the print blank # # fields option is turned on print the form field and value. # foreach $sorted_field (@sorted_fields) { if ($Config{'print_blank_fields'} &#0124; &#0124; $Form{$sorted_field}) { print "<b>$sorted_field:</b> $Form{$sorted_field}<p>\n"; } } }

# Otherwise, default to the order in which the fields were sent. # else {

# For each form field, if it has a value or the print blank # # fields option is turned on print the form field and value. # foreach $field (@Field_Order) { if ($Config{'print_blank_fields'} &#0124; &#0124; $Form{$field}) { print "<b>$field:</b> $Form{$field}<p>\n"; } } }

# Basic syntax requires: one or more characters before the @ sign, # # followed by an optional '[', then any number of letters, numbers, # # dashes or periods (valid domain/IP characters) ending in a period # # and then 2 or 3 letters (for domain suffixes) or 1 to 3 numbers # # (for IP addresses). An ending bracket is also allowed as it is # # valid syntax to have an email address like: user@[255.255.255.0] #

# Begin Addition Of Database # Database addition based on YForm's with few modifications

# ASHLEY: The code to write form submissions to a text file on your server # This feature ONLY WORKS IF you specify fields in the "data_fields_to_log" # and/or "data_env_to_log" in your form config. - YForm sub appendit { # Localize variables used in this subroutine. # local($sort_order,$sort_env,$sorted_field,$sorted_env);

<html> <head> <title>Error: No Recipient</title> </head> <body bgcolor=#FFFFFF text=#000000> <center> <table border=0 width=600 bgcolor=#9C9C9C> <tr><th><font size=+2>Error: No Recipient</font></th></tr> </table> <table border=0 width=600 bgcolor=#CFCFCF> <tr><td>No Recipient was specified in the data sent to FormMail. Please make sure you have filled in the 'recipient' form field with an e-mail address. More information on filling in recipient form fields can be found in the README file.<hr size=1>

Sorry for the delay I took a look at it last night and I must have over-looked the code where the data base is opened. But the code looks fine. I can't see why it isn't writing anything. I can only suggest that you change

Thanks I'll add the full path to it. I will let you know what happens after I test it out. What is your Email address? IF you ever need help with anything I'll be glad to help you out, MCompServices@usa.net. AIM is jediguy98. See ya later. Thanks again.