[Zope] Dtml-if question

yan zhang yanzhang868@yahoo.com
Tue, 15 Jul 2003 12:56:11 -0700 (PDT)


Hi All,

I am very confusion about the following question:
dtml-if to test an integer and string.

Two sql methods:

1)   testPassword

select pd from reader where <dtml-sqltest name op=eq
type=string >

2) getID     (This parameter (pID) is an integer, if
signed reader, pID = 1, if not signed, pID = 0)

select pID from reader where <dtml-sqltest name op=eq
type=string >

Form:
<form name="Form" method="GET" action="TestpID">      


<font face="Arial, Helvetica, Geneva"
size=-1>ID:</font>
<input name=name size=20 maxlength=32>

<br><font face="Arial, Helvetica, Geneva"
size=-1>Password:</font>
<input name=pd size=20 maxlength=32>

<br><font face="Arial, Helvetica, Geneva" size=4>
<input type=submit value="Test">
</form>

Dtml method:

1)TestpID

<dtml-try>
<dtml-if "pd == testPassword(name=_['name'])">
Work now
<dtml-else>
not works
</dtml-if>
</dtml-try>

Problem is:
I always get the "not works" result.

2)1)TestpID

<dtml-try>
<dtml-if "getID(name=_['name']) == 1">
Work now
<dtml-else>
not works
</dtml-if>
</dtml-try>

Problem is:
I always get the "not works" result, Even I test zsql
method is right.

Many thanks for any of your advice.

Yan


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com