English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

im using this code


Enter Your Comments:






but where how how is the submitted information saved? Is it possible to generate a .txt file?

2007-03-19 13:31:24 · 2 answers · asked by AnaheimBIT 1 in Computers & Internet Programming & Design

2 answers

The submitted data will be sent to your specified cgi-script, in your example that would be /cgi-bin/example.cgi-

in that file you can issue the following command

read(STDIN, my $Daten, $ENV{CONTENT_LENGTH});

You get your data in $Daten, in this format :
Comments=Word+Word+Word& AnotherFormField=Data

Word+Word+Word represents the text that has been entered in your textarea-

if you have php capabilities, it is much easier to get your data. check your server if you are allowed to use php. in that case you example would work like this:

Action="someDir/example.php"

in example.php you can use $_POST['formfieldname'] to access your information like this:

$Comments = $_POST['Comments'];
echo $comments; // this will output you comment

If you have more formfields you can take a look at your entire data-structure like this :

$Postdata = $_POST; // read the whole POST-Array

echo "

"; // this is only for better readability
print_r($Postdata);
echo "
";

2007-03-19 13:49:14 · answer #1 · answered by Anonymous · 0 0

The example.cgi program, whatever that is, is responsible for accepting the form data and doing something with it.

Yes, the example.cgi program can do all sorts of things, including generating a .txt file.

2007-03-19 20:35:20 · answer #2 · answered by BigRez 6 · 0 0

fedest.com, questions and answers