codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Writing form data to output files  chooka62 at 14:40 on Friday, April 27, 2007
 

Hi there,

Im new to perl/cgi and I am having a few problems trying to get my data to write to my text file. I think that I have done everything right but obviously I'm here so I havent. I can get my data to write straight in html form, or send to an email. But whenever I seem to execute the cgi file it doesnt write to the text file. Here is the code listed below that I am using.

#############################
## DATA WRITTEN TO OUTFILE ##
#############################

open(OUTFILE, "/forum/gtgtoutput.txt"); #open outfile with name "/forum/output.txt"

print OUTFILE "Comments Data:\n\n";
print OUTFILE "Name: $name\n";
print OUTFILE "Surname: $surname\n";
print OUTFILE "Address: $address\n";
print OUTFILE "Phone: $phone\n";
print OUTFILE "Email: $email\n";
print OUTFILE "Comments: $comments\n\n";

close(OUTFILE);

The data is read in from a form and should write to the output.txt file! Whenever I execute the file from the command line I get:

Comments Data:

Name:
Surname:
Address:
Phone:
Email:
Comments:

Obviously that is right because there is nothing passed in. But when I do it from the form it doesnt work at all.
Can someone please give me some insight to this issue. That would be great!!
Cheers








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Re: dynamic crystal report generation
•  Writing form data to output files
•  date of birth validation using java script-very urgent
•  c++ beginner need some help
•  Menu.Prototype.cssFile
•  Perl`s Greedy and Non-Greedy Quantifiers
•  Perl`s Regular Expression Engine
•  Perl`s Regular Expression Engine
•  mysql issue with delete


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007