[ZPT] ZPT and ZSqL question
    Tom Twyman 
    fr0gger03 at hotmail.com
       
    Tue Oct 11 21:28:18 EDT 2005
    
    
  
Hello all!
I am trying to construct a login page.  I have users registering on the site 
using ZPT, python script, and ZSQL methods, and their account information is 
held in a table ("clients") in a psql database.  Now, I want to be able to 
garner their clientid (primary key) during login, and pass it as an argument 
to another page.
I have the following as the login:
Page ID: 'login'
<form action="login.py" method="post">
<p>email:
<br>
<input type="text" name="email:string:required"  size="50"></p>
<p>password:
<br>
<input type="password" name="password:string:required"  size="50"></p>
<p><input class="submit" type="submit" name="submit" value="login" /></p>
</form>
The following is the python script: 'login.py'
(parameters=email, password)
# get sql method
select=container['sql_login']
# call it, passing arguments
select(email=email,password=password)
# return a confirmation page
page=container['fmvwsched']
return page()
Finally, the following is the sql method: 'sql_login'
(arguments=email, password)
select clientid from clients where email=<dtml-sqlvar email type=string> and 
password=<dtml-sqlvar password type=string>
I am sure this should be simpler than I am trying to make it, but I'm stuck.
Any help would be greatly appreciated.  Thanks!
Tom
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
    
    
More information about the ZPT
mailing list