i need a perl code that will take a the input form my 1 question form (name) and print it on a new line with <br> after it in a text file (submit.txt) please can someone either write one up for me as simple as is posible or somthing, o and it has to be Appending so it adds it to the old data, i tried writing one but it failed miserably and my server told me to go find a person to do it for me so can anyone help??
evilbenking
Recommended Answers
Jump to PostHere's a simple bit of code I put together:
#!/usr/bin/perl use strict; use CGI qw(:standard); my $query = new CGI; my %vars; foreach my $key (sort {$a <=> $b} $query->param()) { $vars{$key} = $query->param($key); } print "content-type: text/html\n\n"; if(open(FILE, ">>testFile.txt")) { print FILE "$vars{'data'}<br>"; close(FILE); print "Success"; …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.