Hi,
I set up an URL when cliking a submit button, I got
http://myhost.com/user/?userid=5987.
In REQEST, I can get useid = request.GET['userid'], but in POST, I could
not get the variable from the POST:
if userid in request.POST
userid = request.POST.get("userid", "")
Despite the userid=5987 was included in the URL, the above check failed,
how can I get variables in URL from POST? Also, not sure if the userid =
request.POST.get("userid", "")
is the correct syntax to get variables from request.POST?
Also, at the moment, I made a hard coded absolutely URL in the submit
action:
<form method="post" action="http://myhost.com/user/?userid={{
request.user_id }}">{% csrf_token %}
Is there a current URL I can put it in the action, for example, like action
= "{{ current_url }}/?userid={{ request.user_id }}"?
Thank you.
Kind regards.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/6438db49-a616-48b0-ae16-dfaa51a2f70f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.