redirect/rewrite for form submissions

Thomas Bennett bennetttm at appstate.edu
Wed Oct 30 09:49:10 EST 2002


  Our Distance Learning group makes an HTML orientation CD each semester for
distance learning students to assist them in using our library services and
contact information, see http://linux.library.appstate.edu/lo/
for the original orientation CD.  This time they included a survey form on
the CD and asked me for a URL for the action element in the form.  Thinking
(or not thinking) I gave them a URL on my apache server that I knew I could
redirect to my Zope server for processing.

  Well, I've found that the redirect does not retain the data submitted with
the form so when it gets to my processing page there is no data to process.
The action URL is http://linux.library.appstate.edu/dl2 where dl2 doesn't
actually exist except when I define the redirect. There is no option to
change the action URL because the CDs are now being reproduced.  The action
URL is going to an Apache server and I am looking into mod_rewrite and/or
mod_python which are loaded on the Apache server.  With mod_rewrite I've
tried:

RewriteRule ^/dl2$ http://linux.library.appstate.edu:8080/

which works as far as a redirect but still does not send the form data.  The
original form that was copied to CD is at
http://www.itc.appstate.edu/lo/html2/form.html which submits to the /dl2
Apache directory.  I have replicated the form at
http://linux.library.appstate.edu:8080/dl/dl_cd2/test which submits to a
page which shows all of the Request information and I have set the rewrite
rule to go to that same information page to verify if the form data shows
up.  By the way, this is the source for that information page on a Zope
server:

<dtml-var standard_html_header>
<h2>Tom's Testing page for Server and Browser Environment settings</h2>
<dtml-var REQUEST>
<dtml-var standard_html_footer>

So here are my questions:
 Can you create a rewrite rule that will also retain the submitted form
data?

 If not, can you use mod_scriptlanguage, in this case python, to receive and
process the data even if the url has no page extension ie. .py, .pl, .cgi?
With this in mind can I define my script with a .html extension and use
index.html to hold my script with this definition:

<Directory /dl2>
    AddHandler python-program .html
    PythonHandler index
</Directory>


 Is there another alternative besides redirecting to the same form on my
server and send an errata with the CD saying just press the submit button
and then fill out the form?

Keep in mind the form results ARE going to
http://linux.library.appstate.edu/dl2 and this can't be changed at this
point on the CD.

TIA
Thomas



PS: I did not create the form, I know yes/no answers should be radio buttons
not check boxes and yes the email label is missing a textbox.  It may not be
obvious that I'm quite displeased not having the form on my server where all
of these things could be corrected before it could even get to this current
situation. ;-(

-----------------------------------------------------------------
  Use The Help Desk at http://linux.library.appstate.edu/help
-----------------------------------------------------------------
                      Rock and Rule
             Zope Rocks -- http://www.zope.org
           Python Rules  -- http://www.python.org
-----------------------------------------------------------------
Thomas McMillan Grant Bennett      Appalachian State University
Computer Consultant III            University Library
Voice:  828 262 6587	           FAX:    828 262 2797

Windows 95 is a 32-bit extension to a 16-bit patch for an 8-bit
operating system that was originally coded for a 4-bit microprocessor.
 - Chris Dunphy     Boot Magazine




More information about the Web4lib mailing list