10.6. Posted Data and %fdat

Posted data—that is, data posted to the server by the client browser (this data was obtained using the param() function in the CGI and mod_perl chapters)—is accessed by Embperl programs through the variable %fdat. Each form widget name is a key in %fdat, and the widget value is the value of that key.

Here’s a simple example. First, there’s a form to collect some data (/var/www/html/embperl/fdat1.html):

 <html> <head> <title>Form to Demonstrate %fdat</title> </head> <body bgcolor="#ffffff"> <h1>A Form to Demonstrate %fdat</h1> <form action="/embperl/fdat2.html" method="post"> Name: <input type="text" name="name"> <br> Age: <input type="text" name="age"> <br> Phone: <input type="text" name="phone"> <br> <input type="submit"> ...

Get Open Source Web Development with LAMP: Using Linux, Apache, MySQL, Perl, and PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.