473,789 Members | 2,740 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

post variable

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
5 1580
pa***********@g mail.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
"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
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
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".
"Redirectin g" 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
En Mon, 28 Jan 2008 19:32:45 -0200, pa***********@g mail.com
<pa***********@ gmail.comescrib ió:
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2466
by: Spud | last post by:
<?php // pullpage function by Nick bouton http://www.nickbouton.com/. $CustomerID = "IDHERE"; $method = "POST"; $host = "xml.mydata.com"; $usepath = "/xml.asp"; //print all vars in an array
3
2677
by: Thomas Hoheneder | last post by:
Hello, I use PHP 4.3.10 and want to deliver a post variable from a PHP page to itself. In my page mypage.php I have a hidden field named "dbaction" and a form button. When clicking the form button a javascript function is called where the dbaction hidden field is set to the value "change" (=actn) and then the form gets submitted. function doAction(actn) { document.forms.dbaction.value = actn;
5
5378
by: Chuck Anderson | last post by:
I have finally started coding with register_globals off (crowd roars - yeay!). This has created a situation that I am not sure how I should handle. I have scripts (pages) that can receive an input variable from the POST array (initial entry) or it could be in the GET array (go back and re-edit a form, for instance.) In my old sloppy scripting days this was no problem, as I had register_globals on and would merely access the the input...
1
2349
by: 55555 | last post by:
what is difference between variable type and object type??
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10410
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4093
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3701
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.