Author Topic: CSVWrite and Windows - Initial Setup Problem  (Read 4779 times)

0 Members and 1 Guest are viewing this topic.

Offline Ryan

  • Jr. Member
  • **
  • Posts: 31
CSVWrite and Windows - Initial Setup Problem
« on: October 26, 2006, 11:39:32 AM »
I am working in a Windows Server 2003 environment with the latest ActivePerl installed. I have somewhat set up the CSVWrite script to work with a simple web form (Name and EMail field only). However, when I try to submit any information I get the error:

"CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers."

My Perl path is pointed correctly in the CSVwrite.pl file. I have MailEnable installed on the server, but do not know how to tie it to CGI scripts in Windows (I am used to FormMail for Unix).

Upon pressing Submit the first time, the file database.txt was written to my cgi-bin directory. I didn't change the path since I was just starting out. Inside the database file were Field1-4 and ID.

Can anyone offer any suggestions on how to get this up and running in Windows so that Email is sent without errors? Correct me if I'm wrong but not having the mail set up correctly would cause the CGI error?

Thanks,
Ryan
« Last Edit: October 26, 2006, 11:48:00 AM by Ryan »
Ryan Taylor

Offline EZ

  • Hero Member
  • *****
  • Posts: 1081
    • Babelnotes.be
Re: CSVWrite and Windows - Initial Setup Problem
« Reply #1 on: October 26, 2006, 12:00:22 PM »
http://www.ezscriptingforums.com/forum/index.php?topic=25.0  Try at least the last one.

The scripts are written for unix/linux servers and their requirements state so.  However, in order to get mails to work, you would need either an smtp server that does not require authentication or sendmail for windows.

Offline Ryan

  • Jr. Member
  • **
  • Posts: 31
Re: CSVWrite and Windows - Initial Setup Problem
« Reply #2 on: October 26, 2006, 01:35:26 PM »
I just installed Sendmail for Windows. I ran its test and the emails came through perfectly to me. My location of the program is C:\Sendmail\sendmail.exe, but my Websites are all on drive D:. How should I word the path in CSVwrite? I tried it as C:\Sendmail\sendmail.exe and it returned the same CGI error as I mentioned above.

I then tried your suggestion adding the line underneath the Perl location and it returned with:

"Sorry, we require more information
ERROR FIELD < ryan@unitedsiteservices.com >: email address is not valid!
Please click 'back' on your browser and try again"

I have that email address set in the Advanced Settings Email:
##########################################################
# Advanced Settings email
my $send_me                  = 1;
my $admin_mail               = 'ryan@unitedsiteservices.com';
my $from                     = 'info@unitedsiteservices.com';
my $from_field_name          = 'ryan@unitedsiteservices.com';
my $email_input_error        = "Non resolved email input";
my $send_just_data        = 1;
my $mailprog                 = 'C:\sendmail\sendmail.exe';
my $subject                  = 'New entry in your database';
my $only_fields_with_values  = 1;
##########################################################

Thank you,
Ryan
« Last Edit: October 26, 2006, 01:41:18 PM by Ryan »
Ryan Taylor

Offline EZ

  • Hero Member
  • *****
  • Posts: 1081
    • Babelnotes.be
Re: CSVWrite and Windows - Initial Setup Problem
« Reply #3 on: October 26, 2006, 01:37:47 PM »
Maybe try c:\\sendmail\\sendmail.exe

But what was the result of the topic 25 I posted?

Offline Ryan

  • Jr. Member
  • **
  • Posts: 31
Re: CSVWrite and Windows - Initial Setup Problem
« Reply #4 on: October 26, 2006, 01:41:51 PM »
Sorry, I was late to modify my post. Please see above.
Ryan Taylor

Offline EZ

  • Hero Member
  • *****
  • Posts: 1081
    • Babelnotes.be
Re: CSVWrite and Windows - Initial Setup Problem
« Reply #5 on: October 26, 2006, 01:49:32 PM »
Send me an email with your script attached in a zip (if you do not have my mail address, send me a short notice through the site's contact page and I will reply).  I will see whether I can do something about it.

Offline Ryan

  • Jr. Member
  • **
  • Posts: 31
Re: CSVWrite and Windows - Initial Setup Problem
« Reply #6 on: October 26, 2006, 01:58:51 PM »
I changed the "$from" line and the "$from_field_name" to match the input names in my form. After submitting the data, the only thing that returned was "You have bad file!"

Do you still want me to send you the script?

Thanks,
Ryan
Ryan Taylor

Offline EZ

  • Hero Member
  • *****
  • Posts: 1081
    • Babelnotes.be
Re: CSVWrite and Windows - Initial Setup Problem
« Reply #7 on: October 26, 2006, 02:11:59 PM »
my $from_field_name          = 'ryan@unitedsiteservices.com';

yes, sorry, looked over this one.  from_field_name should indeed be the fieldname that contains the mail address of the submitter.

You have bad file means that the database is corrupt.  Delete it and retry.

Offline Ryan

  • Jr. Member
  • **
  • Posts: 31
Re: CSVWrite and Windows - Initial Setup Problem
« Reply #8 on: October 26, 2006, 02:19:29 PM »
Ok we have progress. I started a new db file from scratch which held it up. The error is now:

Field realname not exist!

"realname" is the name of my input field for the users name. I've replaced the >< with )( for the forum:

(form name="Contact_Form" method="POST" action="/cgi-bin/csvwrite.pl")
Name:
(input type="text" name="realname")
E-Mail:
(input type="text" name="email")
(input type="submit" name="Submit" value="Submit")
(/form)

Do I have the code right in the script?
my $from                     = 'realname';
my $from_field_name          = 'email';
« Last Edit: October 26, 2006, 02:26:05 PM by Ryan »
Ryan Taylor

Offline EZ

  • Hero Member
  • *****
  • Posts: 1081
    • Babelnotes.be
Re: CSVWrite and Windows - Initial Setup Problem
« Reply #9 on: October 26, 2006, 03:08:20 PM »
your form looks ok and $from does not matter, since the value of the email field will override it.

But do you get this "Field realname not exist" when you really delete the existing database?  I mean...  just delete the database file and then submit the form?

What I am saying here is that you do not need to create a database file, the script will do it for you.

PS: no need to strip out the <> on this forum...
« Last Edit: October 26, 2006, 03:11:11 PM by EZ »

Offline EZ

  • Hero Member
  • *****
  • Posts: 1081
    • Babelnotes.be
Re: CSVWrite and Windows - Initial Setup Problem
« Reply #10 on: October 26, 2006, 03:12:26 PM »
Another thing (although it has nothing to do with your problem) is that you better replace:
<input type="submit" name="Submit" value="Submit">
by
<input type="submit" value="Submit">

Otherwise the script will create a field "Submit" in your database.  Harmless, but it's just eating space...

Offline Ryan

  • Jr. Member
  • **
  • Posts: 31
Re: CSVWrite and Windows - Initial Setup Problem
« Reply #11 on: October 26, 2006, 03:15:06 PM »
When I delete the database and try to submit the form, it comes back with the correct "C:\path\path\path\database.txt can not be found" or similar. I've added the original database back that was created from the script, and it comes back with the "Field realname does not exist" even though I have changed the my $from = 'realname'; to my $from = 'info@unitedsiteservices.com';. So I went into the html code and changed my "realname" input field to "name", and the error the script gives back becomes "Field name does not exist". So it looks like that particular input field is not being fed to the cgi script correctly?

Ryan
« Last Edit: October 26, 2006, 03:19:55 PM by Ryan »
Ryan Taylor

Offline EZ

  • Hero Member
  • *****
  • Posts: 1081
    • Babelnotes.be
Re: CSVWrite and Windows - Initial Setup Problem
« Reply #12 on: October 27, 2006, 03:46:03 AM »
ok, then the path definition is not correct.  Adalby might be able to help you better, he's used to using the scripts on IIS.

But do not use the original database anymore.  Let the script create it once you find out how to define the path.

One thing you might try is to type your path like c:\\path\\path\\path\\database.txt

The script is reading all your fields well.  It just does not find the field name in your database...

Offline Ryan

  • Jr. Member
  • **
  • Posts: 31
Re: CSVWrite and Windows - Initial Setup Problem
« Reply #13 on: October 27, 2006, 07:02:41 AM »
Ok I see what you're saying. I'll wait for Adalby to pop around and try that style path while I wait. Thanks for all your help with this.
Ryan Taylor

Offline ADalby

  • Hero Member
  • *****
  • Posts: 241
    • Uniting Bands - Where Talents Unite! - Music Promotion, Musician Classifieds
Re: CSVWrite and Windows - Initial Setup Problem
« Reply #14 on: October 27, 2006, 07:15:37 AM »
Hello Ryan, I am using Windows 2003 server just like you. I have many different instances and all functionality of the scripts are working perfectly. I will post a couple lines for you from my write script so you can look at. give me some specific questions if you can't figure it out. Let me know if this works out for you.

Thanks,
Aaron

my $base_file                = '/Inetpub/wwwroot/cgi-bin/EZ/database.txt';

-------------------
my $admin_mail               = 'adalby@xxx.com';
my $from                       = '';
my $from_field_name         = 'email';
my $email_input_error     = "Non resolved email input";
my $send_just_data       = 0;
my $mailprog                  = 'c:\Inetpub\scripts\sendmail.exe';
Uniting Bands
www.unitingbands.com