[Zope] - creating a MySQL login form
Phil Wilson
phwilson@poboxes.com
24 Dec 1998 18:46:27 -0000
I'm just starting with Zope and have some questions:
1. In the form below, it gives me this error when calling manage_open_connection:
<!--
Error type:
Error value: PATH_INFO
-->
what is wrong with the call?
2. If I change 'conn' to user in the manage_addZMySQLConnection(), how do I address user in manage_open_connection()? i.e.
MySQL.manage_addZMySQLConnection(user, ...)
MySQL.user.manage_open_connection()
is what I'm trying to accomplish.
3. How do I trap exceptions in DTML (i.e. if login fails)?
---------------------
<!--#if user-->
<!--#call "MySQL.manage_addZMySQLConnection('conn','','mysql %s %s' % (user,password))"-->
<!--#call "MySQL.conn.manage_open_connection()"-->
<!--#comment-->
if successful do_something_interesting
else notify_failure
<!--#/comment-->
<!--#else-->
<H2><!--#var title_or_id--> <!--#var document_title--></H2>
<form action="login">
<table>
<tr><td>User:</td><td><input type="text" name="user"></td></tr>
<tr><td>Password:</td><td><input type="password" name="password"></td></tr>
</table>
<P>
<input type="submit" value="Login">
</form>
<!--#/if-->