Hello,
I'm having a little problem with POST and URL (GET) variables in the same request. When submitting a form only the POST variables are being received by the "action" even if I specify a variable in the action's query string.
I guess this is better explained with a little example:
Lets say I have this form:
< form id='test' name='test' action='test-target?getvar=123' method='POST'>
< input type='text' name='postvar' id='postvar'>
< input type='submit' value='submit'>
</ form>
Here the action is defined as: 'test-target?getvar=123', with a URL variable clearly defined and I have a field with the name 'postvar', this form is being submitted with the method POST.
Now on the form's target I have:
ad_page_contract {
} {
{getvar "lost variable"}
{postvar "lost variable"}
}
set parameters [ns_getform]
set method [ad_conn method]
set urlv [ad_conn urlv]
set get_var_set [ns_set get $parameters "getvar"]
set post_var_set [ns_set get $parameters "postvar"]
#info about the method and URL used
ns_log notice "method = $method"
ns_log notice "urlv = $urlv"
#Info from the ns_getform.
ns_log notice "get_var_set = $get_var_set"
ns_log notice "post_var_set = $post_var_set"
#Info from the variables defined on the page contract
ns_log notice "getvar = $getvar"
ns_log notice "postvar = $postvar"
If I check my log I get:
Notice: method = POST
Notice: urlv = test-target
Notice: get_var_set = < -------
Notice: post_var_set = var from post
Notice: get_var = lost variable < -----
Notice: post_var = var from post
The value from the "getvar=123" is now missing.
-----------------------------------------------------
I have tried this using AOLServer 4.10 and 4.5, using OpenACS 5.3.
Is there a way to use both of this variables??
Thank you in advance for your help.