Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > post variable

Reply
Thread Tools

post variable

 
 
pavloutefkros@gmail.com
Guest
Posts: n/a
 
      01-28-2008
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 .
 
Reply With Quote
 
 
 
 
Diez B. Roggisch
Guest
Posts: n/a
 
      01-28-2008
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
 
Reply With Quote
 
 
 
 
Hrvoje Niksic
Guest
Posts: n/a
 
      01-28-2008
"" <> writes:

> 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.
 
Reply With Quote
 
pavloutefkros@gmail.com
Guest
Posts: n/a
 
      01-28-2008
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.
 
Reply With Quote
 
bruno.desthuilliers@gmail.com
Guest
Posts: n/a
 
      01-28-2008
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) !

 
Reply With Quote
 
Gabriel Genellina
Guest
Posts: n/a
 
      01-29-2008
En Mon, 28 Jan 2008 19:32:45 -0200,
<> escribió:

> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Variable variable name" or "variable lvalue" mfglinux Python 11 09-12-2007 03:08 AM
Variable = Variable? (re post) Ron ASP .Net 3 07-21-2005 07:45 PM
How do I scope a variable if the variable name contains a variable? David Filmer Perl Misc 19 05-21-2004 03:55 PM
wlftg17 modelsim temp file beeing too big (corret post, ignore the old post) Oleg VHDL 0 04-05-2004 03:31 AM
Post post post. Shel-hed Computer Support 2 11-08-2003 07:41 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57