On Thu, May 8, 2008 at 10:36 PM, globalrev <[EMAIL PROTECTED]> wrote:
> web.input gives you access to any variables the user submitted through
> a form.
> but how? what form where? a good example would help a lot.
>
> if i have a form on the page /signup how do i get that info?

globalrev,
lets say you have this html form:

<form method=post>
user: <input type="text" name="username" /><br />
pass: <input type="text" name="password" /><br />
<input type="submit" value="submit" /><br />
</form>

and this python code:

urls = ('/signup','signup')

class signup:
  def POST(self):
    i = web.input()

    # username post info
    user = i.username
    # username post info
    pass = i.password

    # database stuff here to save the new user.

If i'm not wrong, that's how you can access to POST values.
it's pretty simple.

btw, here its an example about how to make a blog with webpy:
http://k4ml.com/wiki/python/webpy/simpleblog

try to not copy-paste all the example and learn from it insted ;)

Regards,
Mauro

-- 
JID: [EMAIL PROTECTED]

----BEGIN GEEK CODE BLOCK----
Version: 3.12
GCM/O d->dpu$ s-:- a-->a+++$ C+++
LU P+ L++ E W+++ N !o K w O !M !V
PS+ PE Y+ PGP t 5- X R tv++ b- DI D++ G+ e
h!>h-- r>r+++ y+
----END GEEK CODE BLOCK----

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to