<div>At last I find and change everything.Now it looks like this:</div><div>------MY DTML DOCUMENT-----</div><div><form action="" method="post"><br /><br><p><br> KULLANICI ADI <br> <input type="text" name="name"><br>
<p><br> SIFRE<br> <input type="text" name="sifre"><br><p><br> SIFRE YENIDEN<br> <input type="text" name="sifret"><br> <input type="submit" name="formParams:action" value="degistir"><br>
</form></div><div> </div><div>----MY EXTERNAL PYTHON METHOD------</div><div>import crypt<br>import MySQLdb<br>def formParams(self,name,sifre,sifret):<br> conn = MySQLdb.connect(host="localhost",<br> user = "xxxx",<br>
passwd = "yyyy",<br> db = "xxxzzz")</div><div> cursor = conn.cursor()<br> <a href="http://self.name">self.name</a>=name<br> self.sifre=sifre<br> self.sifret=sifret<br>
if sifre == sifret:</div><div> cryp = crypt.crypt(sifre,'mysecret')<br> cursor.execute("""update mytable set PASS_WORD=%s where USERNAME=%s""",(cryp,name))<br> return "BASARI ILE DEGISTIRILDI"<br>
else:<br> return "Sifreler uyusmadi.Tekrar deneyiniz."<br> cursor=conn.close()<br><br><br></div><div class="gmail_quote">On Mon, Jan 7, 2013 at 11:16 PM, Mike Cullerton <span dir="ltr"><<a href="mailto:plone@bakednotfried.com" target="_blank">plone@bakednotfried.com</a>></span> wrote:<br>
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote"><div style="word-wrap:break-word">It looks like you missed some quotes.<div>
<br></div><div>this line</div><div class="im"><div> cryp = crypt.crypt(sifre,'mysecret')</div><div><br></div></div><div>should probably be</div><div> cryp = crypt.crypt('sifre','mysecret')<div><br>
</div><div>Mike</div><div><br><div><div><div class="h5"><div>On Jan 7, 2013, at 1:33 PM, murat bilal <<a href="mailto:murat.bilal@gmail.com" target="_blank">murat.bilal@gmail.com</a>> wrote:</div><br></div></div><blockquote type="cite">
<div><div class="h5"><div>Hi,</div><div> </div><div>I try to make a simple paswd recovery page for my site.Username and password stored in mysql db.My DTML document is:</div><div><form action="deg" method="POST"> </div>
<div> <h2>Şifre değiştirme sayfasına hoşgeldiniz<h2><br><br><br> KULLANICI ADI: <br><input type="text" name="name:ignore_empty"></br><br><p><br> ŞİFRE: <br> <input type="text" name="sifre:ignore_empty"></br><br>
<p><br> ŞİFRE TEKRAR: <br> <input type="text" name="sifret:ignore_empty"></br><br><p><br> <input type="submit" value="yenile" align="center" ><br>
<dtml-var "deg(REQUEST)"></div><div></form></div><div> </div><div>and my external python method is as follows:</div><div> </div><div>import crypt<br>import MySQLdb<br>conn = MySQLdb.connect(host="localhost",<br>
user = "rxxxx",<br> passwd = "yyyy",<br> db = "zzzz")</div><div>cursor = conn.cursor()<br>#return context.responseMessage()<br>
def deg(self):</div><div> <br> cryp = crypt.crypt(sifre,'mysecret')<br> if request.form["sifre"] == request.form["sifret"]:<br> cursor.execute("""update mytable set PASS_WORD=%s where USERNAME=%s""",(cryp,name))<br>
print "SUCCESS"<br> else:<br> print "please try again!"<br>cursor=conn.close()<br></div><div>But when i tested from DTML Document I got this error <p><strong>Error Type: NameError</strong><br>
<strong>Error Value: global name
'sifre' is not defined</strong><br></p><p>Can anybody help me?</p><p>Regards</p><p>MuratB</p><div> <br></div><div> <br></div><div> <br></div></div></div></div>
_______________________________________________<br>Zope maillist - <a href="mailto:Zope@zope.org" target="_blank">Zope@zope.org</a><br><a href="https://mail.zope.org/mailman/listinfo/zope" target="_blank">https://mail.zope.org/mailman/listinfo/zope</a><br>
** No cross posts or HTML encoding! **<br>(Related lists -<br> <a href="https://mail.zope.org/mailman/listinfo/zope-announce" target="_blank">https://mail.zope.org/mailman/listinfo/zope-announce</a><br> <a href="https://mail.zope.org/mailman/listinfo/zope-dev" target="_blank">https://mail.zope.org/mailman/listinfo/zope-dev</a> )<br>
</blockquote></div><br></div></div></div></blockquote></div><br>