[Zope] combining form variables and URL values

Geir Bækholt Geir Bækholt
Tue, 10 Jun 2003 22:23:51 +0200


On  Tue, 10 Jun 2003 15:41:41 -0400 GMT (..21:41 where i live(GMT+2) )
jwsacksteder@ramprecision.com asked the Zope mailinglist about the following:
  
> I'm quite sure how I should be thinking about this.

> I  have a page creates a report based on parameters that are in the URL=
.
> This is important because the user must be able to bookmark the locatio=
n
> with the parameters included. For the sake of this example let's say th=
e url
> looks like this-
> http://www.myserver.com/news/index_html?UID=11234;skin=modern

> On that page 'UID' and 'skin' are available to dtml-var. I have a form =
on
> that page that take 2 additional input fields from the user(using formu=
lator
> if that matters). I need to then pass all four values into a dtml metho=
d for
> validation, then into a zsql method. Unfortunately 'UID' and 'skin' are=
 only
> in the namespace of the initial page, thus this doesn't work. 

> I think the solution would be to make some hidden fields in the form an=
d set
> their values according to the values on 'UID' and 'skin'. Then once the=
 form
> results are passed through the validator all 4 values will be available=
 to
> the zsql method.  

> Is this the most direct way to accomplish this goal?

For a set of only two 'pages' this would be the simplest and most
straightforward solution, and it works just fine the way you described
it.

For more complex situations, look into using sessions.
( http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/Sessions.st=
x )

:)

--
Geir Bækholt