CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Need a Custom or Prewritten Perl Program?: I need a program that...:
Need form to file

 



vernacularweb
Deleted

Apr 30, 2001, 9:35 PM

Post #1 of 2 (716 views)
Need form to file Can't Post

I need a form to file processor that will not add any additional characters to the output of the file and does not append to an existing file. Example below.

FORM FIELDS
<input type="hidden" name="[user info]" value="">
<input type="text" name="user=">

OUTPUT OF FORM WILL SHOW ONLY:
[user info]
user=chad (assuming that the user entered chad)

I need this processor not to include any other information other than what is comming from the form!

Thank you for your help,
Chad Taylor



WilliamC
stranger

Oct 20, 2001, 8:17 AM

Post #2 of 2 (681 views)
Re: Need form to file [In reply to] Can't Post

#!/usr/bin/perl

$filepath="/path/to/output/directory";

use CGI ':cgi';

$user=param('user');

if(-e "$filepath/$user.txt") {
# add a choose new username function
} else {
open(OUT, ">$filepath/$user.txt");
print OUT "[user info]\n";
print OUT "user=$user\n";
close(OUT);
}
# redirect user accordingly.

exit;


http://perlcoders.com members area has a custom forms script generator.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives