3

Really stupid question here... but I can't seem to figure it out. In PHP when passing url params for say: www.mysit.com/index?name=steve I would use:

$_GET["name"]

In web2py I know you can get stuff via request.vars.someNameAttribute for stuff like what text is within a box. But how do I get params straight from the url string? Specifically I have form like this:

<form action="add_comment?idnum=5">
     <input type="text" name="comment_text"/>
     <input type="submit"/>
</form>

In the controller def add_comment(), how do I get that the idnum is 5??? I've been trying request.vars.idnum but this doesn't return anything. Am I not calling it right? Or is there some issue with the way I'm passing it in the "action" attribute?

Steel Nation
  • 510
  • 8
  • 26

1 Answers1

2

Nvm, figured it out.

request.vars.idnum is indeed the way to go... it just wasn't working because the method attribute of was not set to "post".

Steel Nation
  • 510
  • 8
  • 26