Re: [Zope] Form POST Question (and a QUERY_STRING Q.)

2000-06-01 Thread Andrew H. Chatham

> Is there a way for me to get the raw posted data and forward that
> too via the RESPONSE object?

What I ended up doing was following Zen's suggestion and creating an
external method that basically does (not an exact quote; it's on another
computer):

def generateForm(self):
outForm = []
for (name, value) in self.REQUEST.form:
outForm.append ('' % (name,
value)
return string.join (outForm, '\n')

It's a little more than that, but I don't have it in front of me. (this
wouldn't deal with quotes right).

I haven't run into the name="mynum:int" problem yet, but maybe that's
just luck, or maybe it's just because of my particular forms. The bad
part is that I don't know of any way to pass POST data on a redirect
(anybody know how to do this, or is this impossible?), so for now I just
have a form that's nothing but a Submit widget with all the other dat a
hidden. 

You can of course change it all into GET data and just join them
together using:
   '%s=%s' % (url_quote_plus(name), url_quote_plus(data))
and joinging with &, in which case you actually can do a redirect, but
presumably someone made it POST for a reason, so I'm not going to mess
with it. It's an inelegant solution and might not work for everything,
but it's all I have for now!

Andrew

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Passing all POST variables?

2000-05-26 Thread Andrew H. Chatham

Hello Zope-people,

I'm writing a LoginManager plugin for a quiz-taking website, and I have
cookies which expire after a manager-defined time. If someone's taking a
quiz for longer than the cookie duration and their cookie expires,
they're going to have to relogin, but I would rather not lose what data
they've entered already.  I have a separate login page so it can be
under SSL, and I adapted the given loginForm and took it's ability to
maintain GET data by passing the QUERY_STRING variable onto the
login-success page and reconstructing the URL there and redirecting to
it.

This works great, but I'd rather not limit people to passing things in
GET, for various reasons (quiz answers showing up in the browser
history, requests being too large, etc.).  But I don't know what the
variables are beforehand, so I can't just pass them along. Is there any
way to pass along all of the POSTed variables through the login page so
that I can redirect to the desired page later with the values intact? Is
this a lost cause? I don't mind if it would require Python to do it, but
is it even possible? I have no idea how to tackle that, but I didn't
even know about the QUERY_STRING variable before I saw the LoginManager
DTML, so maybe there is hope.

Of course, I'm not even sure this would even work HTML-wise, since I
don't know a way to pass GET data and do a redirect at the same time.
May not be possible (is there a workaround for that?)

Oh, and I have absolutely no opinion on Perl ;-)

Thanks,
Andrew


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )