By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,797 Members | 1,169 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,797 IT Pros & Developers. It's quick & easy.

post variable

P: n/a
sorry for creating a new post but this is totally different from the
previous one.

Here is the problem (which is very hard to explain, so i will use a
paradigm): i submit a form and the post variable is being sent to the
page test.py. then the test.py retrieves the POST and print it to the
page. now everything is great except one thing.

lets say i submitted the form and went to test.py and the output was
correct, then, while i'm on test.py if i reload the page, the POST
variable IS STILL THERE.

so the output is always the POST retrieven at first. So the page keeps
on printing the POST variable retrieven at first even thought i might
have reloaded the page 1000 times. Is there any way to "empty" the
POST variable, so that at reload nothing would be the same?

ps: so many "so" and wacky explanation, noone would understand :(.
Jan 28 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
pa***********@gmail.com schrieb:
sorry for creating a new post but this is totally different from the
previous one.

Here is the problem (which is very hard to explain, so i will use a
paradigm): i submit a form and the post variable is being sent to the
page test.py. then the test.py retrieves the POST and print it to the
page. now everything is great except one thing.

lets say i submitted the form and went to test.py and the output was
correct, then, while i'm on test.py if i reload the page, the POST
variable IS STILL THERE.

so the output is always the POST retrieven at first. So the page keeps
on printing the POST variable retrieven at first even thought i might
have reloaded the page 1000 times. Is there any way to "empty" the
POST variable, so that at reload nothing would be the same?

ps: so many "so" and wacky explanation, noone would understand :(.
If you are reloading a page, the variables that were sent to it are
re-send by the browser. I fail to see where the problem is. Reloading
means reloading.

Diez
Jan 28 '08 #2

P: n/a
"pa***********@gmail.com" <pa***********@gmail.comwrites:
so the output is always the POST retrieven at first. So the page
keeps on printing the POST variable retrieven at first even thought
i might have reloaded the page 1000 times. Is there any way to
"empty" the POST variable, so that at reload nothing would be the
same?
Have test.py send a redirect to another page (or to itself, sans the
params). Then reloading won't resend the POST params.
Jan 28 '08 #3

P: n/a
1. yes i've tried that technique but its annoying, the user can easily
stop the redirection and not "elegant".

2. yes i'm aware of that, however what i've mentioned above is just an
example, it's actually way more serious.

guess i'll have to bare with it.
Jan 28 '08 #4

P: n/a
On 28 jan, 22:32, "pavloutefk...@gmail.com" <pavloutefk...@gmail.com>
wrote:
1. yes i've tried that technique but its annoying, the user can easily
stop the redirection and not "elegant".
It's a very canonical technique with HTTP (at least after a successful
POST). But I suspect you're not doing it the right way, since you're
talking about "the user (...) stop(ing) the redirection".
"Redirecting" here means "sending an HTTP redirection status code and
the appropriate location header" (according to the rfc, code should be
303, but for legacy reasons it's often a 302). You must indeed *not*
have send *anything* else to the client before (which means that you'd
better use a log file to trace your code) !

Jan 28 '08 #5

P: n/a
En Mon, 28 Jan 2008 19:32:45 -0200, pa***********@gmail.com
<pa***********@gmail.comescribió:
1. yes i've tried that technique but its annoying, the user can easily
stop the redirection and not "elegant".

2. yes i'm aware of that, however what i've mentioned above is just an
example, it's actually way more serious.
See this sequence:

User POSTs a form
Web app processes the form.
Web app updates its internal state.
Web app don't output anything, and finishes the POST handling with a
redirect (implicit GET)

Browser receives the redirect and issues a GET request
Web app returns content

The important thing is that a POST request *never* returns content, always
redirects. All content is retrieved using GET.

--
Gabriel Genellina

Jan 29 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.