the database stuff isnt supposed to be in there.

anyway if i want to use javascript should i then write the encrypt/
decrypt funcs in javascript?
im looking to javascript now at w3schools.

anyway i appreciate your effort but it s a bit messy. is it basically
the web.seeother function i want to use?

why am i doing a web.input in the GET?

On 10 Maj, 05:19, Eric Talevich <[EMAIL PROTECTED]> wrote:
> Actually, you don't really even need to go back to the server for this
> -- you can use Javascript to scramble/unscramble the strings. But
> since this is clearly a CGI exercise, let's do it that way.
>
> The database stuff is completely separate from showing anything in the
> textareas. What you want is more like:
>
> def GET(self):
>     i = web.input(enc_text="", dec_text="")
>     print render.main(i.enc_text, i.dec_text)
>
> def POST(self):
>     i = web.input()
>     # save or log the input here, if you want, see TFM
>     enc_text = dec_text = ""
>     if i.encdec == "encrypt": enc_text = rob.encrypt(i.dec); dec_text
> = i.dec
>     else: dec_text = rob.decrypt(i.enc); enc_text = i.enc
>     web.seeother('/?enc_text=%s&dec_text=%s' %
> tuple(map(urllib.escape, (enc_text, dec_text))))  # see py docs for
> which url-escaping function to use
>
> And in the template you'll have:
> <textarea name="enc">$enc_text</textarea>
>
> NB: The above code probably won't execute. Also, orange? Jesus.
--~--~---------~--~----~------------~-------~--~----~
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