[Zope] Trouble accessing posted variables outside namespace
Doug Goodwin
dgoodwin@cairn.com
Fri, 10 Dec 1999 08:25:14 -0700
Hey Zope fans,
I'm having trouble with variables. My user has just submitted a
registration form and I want to do the following things:
1. Check to see if the posted email address exists in my users table
|
|--If so, send a email message reminding them of their username & passwd
|
|--If not, insert the posted variables into the dB & send welcome email
I'm having trouble accessing variables I can use outside of the
<dtml-in ...></dtml-in> namespace. IS there a way to create a global
array, stuff all the form info into it on hitting the page and then
manipulate items within the array with methods? That would be way
cool.
Thanks in advance -- the code fragment follows.
-Doug Goodwin
dgoodwin@cairn.com
Here's a code fragment:
<dtml-call "REQUEST.set('userexists', 'UNKNOWN')">
<!-- username is set to the user's email address -->
<!-- Check our SQL dB to see if this email address already exists -->
<dtml-call checkemail>
<dtml-in checkemail>
<dtml-if expr="username == '' ">
<dtml-with REQUEST>
<!-- How do I get the values of these variables outside checkmail?-->
<dtml-call "REQUEST.set('username', username)">
<dtml-call "REQUEST.set('password', password)">
<dtml-call "REQUEST.set('userexists', 'FALSE')">
</dtml-with>
<!-- Send the welcome email -->
<dtml-else>
<dtml-with REQUEST>
<dtml-call "REQUEST.set('userexists', 'TRUE')">
</dtml-with>
<!-- Send the reminder email -->
</dtml-if>
</dtml-in>
<dtml-if expr="userexists == 'TRUE' ">
Forgotten your password? Check your email box for a reminder.
<!--#call sendreminder-->
<dtml-else>
<h1>Thank you for registering!</h1>
<p>
Your username is <dtml-var email>
You will be receiving an email message with your password for 3Dmodelserver.com
<!--#call insertuser-->
<!--#call sendwelcome-->
</dtml-if>