473,386 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How can a form set to 'get' return 'post'????

I have a form which the user fills out to enter some data.

If there already exists an uncompleted session - say, the user started
entering some data but had to stop to do something else - the user has
the option of selecting that session from a drop-down menu (think
<form><select><option>....</option></select></form>). The method for
that particular form is set to 'GET' and the action is
$_SERVER['PHP_SELF']. The <selecttag has a bit of javascript
(onChange) which, when the session is chosen, triggers a 'submit' of
the uncompleted session's session ID number.

So the user selects the uncompleted session, the session ID is looked
up, the data retrieved, and the page reloads and shows the data which
they (or someone else) already entered, retrieved from a mySQL table
(using the session ID) designated to temporarily store data from
uncompleted sessions until it is ready to be written to the
'permanent' tables. At this point the user should update any
information if so desired, then click on "Submit" at the bottom of the
page to update the table and go on to the next page of the form. This
causes the same page to reload, validation is run, and if it passes it
again reloads the page only this time it sets a flag to write a <meta>
redirect tag to the page. The page is reloaded but instantly
redirected to the next page (I couldn't use "header()" because the
headers are already written).

The validation script is part of the same document. There is an IF
statement at the head of the validation portion - if
($_SERVER['REQUEST_METHOD'] == 'POST'). This should, in theory,
prevent the script from running a retrieved 'open session' through the
validation, at the end of which if everything passes validation the
data for that session is updated (or if it is a new
session ,inserted). It should only be invoked if someone presses the
"Submit" button at the bottom of the page, which is set to "POST". So
in theory, the validation should only be run when "submit" is clicked
by the user, not when an open session is selected and "submit" is sent
by the 'onChange' javascript.

What's going screwy is that the open session's request method is
coming back as "POST" even though it is explicitly set as "GET". So
when an open session is retrieved, the page reloads, the validation is
run, everything checks out so the data is updated and the browser
loads the next page, without the user getting the opportunity to
update any of the retrieved open session's data.

I hope I have explained this clearly. Can someone tell me why the
first submit - the one for the drop-down menu of open sessions - is
returning POST even though it is set to GET? This is screwing
everything up and I can't figure a way around it.

May 6 '07 #1
2 2275
On May 6, 6:42 pm, ryn...@gmail.com wrote:
I have a form which the user fills out to enter some data.

If there already exists an uncompleted session - say, the user started
entering some data but had to stop to do something else - the user has
the option of selecting that session from a drop-down menu (think
<form><select><option>....</option></select></form>). The method for
that particular form is set to 'GET' and the action is
$_SERVER['PHP_SELF']. The <selecttag has a bit of javascript
(onChange) which, when the session is chosen, triggers a 'submit' of
the uncompleted session's session ID number.

So the user selects the uncompleted session, the session ID is looked
up, the data retrieved, and the page reloads and shows the data which
they (or someone else) already entered, retrieved from a mySQL table
(using the session ID) designated to temporarily store data from
uncompleted sessions until it is ready to be written to the
'permanent' tables. At this point the user should update any
information if so desired, then click on "Submit" at the bottom of the
page to update the table and go on to the next page of the form. This
causes the same page to reload, validation is run, and if it passes it
again reloads the page only this time it sets a flag to write a <meta>
redirect tag to the page. The page is reloaded but instantly
redirected to the next page (I couldn't use "header()" because the
headers are already written).

The validation script is part of the same document. There is an IF
statement at the head of the validation portion - if
($_SERVER['REQUEST_METHOD'] == 'POST'). This should, in theory,
prevent the script from running a retrieved 'open session' through the
validation, at the end of which if everything passes validation the
data for that session is updated (or if it is a new
session ,inserted). It should only be invoked if someone presses the
"Submit" button at the bottom of the page, which is set to "POST". So
in theory, the validation should only be run when "submit" is clicked
by the user, not when an open session is selected and "submit" is sent
by the 'onChange' javascript.

What's going screwy is that the open session's request method is
coming back as "POST" even though it is explicitly set as "GET". So
when an open session is retrieved, the page reloads, the validation is
run, everything checks out so the data is updated and the browser
loads the next page, without the user getting the opportunity to
update any of the retrieved open session's data.

I hope I have explained this clearly. Can someone tell me why the
first submit - the one for the drop-down menu of open sessions - is
returning POST even though it is set to GET? This is screwing
everything up and I can't figure a way around it.
sounds liek the javascript attached to the onchange is setting the
forms method to post. Unless post is in the actual markup in which
case your statement that it is set to GET is not true, I assume youve
looked and know youre right, so the only other option is that the
javascript changes it prior to submitting the selected session.

May 6 '07 #2
Check your variable hierarchy. You can reset it for the page.

<ry****@gmail.comwrote in message
news:11*********************@n59g2000hsh.googlegro ups.com...
>I have a form which the user fills out to enter some data.

If there already exists an uncompleted session - say, the user started
entering some data but had to stop to do something else - the user has
the option of selecting that session from a drop-down menu (think
<form><select><option>....</option></select></form>). The method for
that particular form is set to 'GET' and the action is
$_SERVER['PHP_SELF']. The <selecttag has a bit of javascript
(onChange) which, when the session is chosen, triggers a 'submit' of
the uncompleted session's session ID number.

So the user selects the uncompleted session, the session ID is looked
up, the data retrieved, and the page reloads and shows the data which
they (or someone else) already entered, retrieved from a mySQL table
(using the session ID) designated to temporarily store data from
uncompleted sessions until it is ready to be written to the
'permanent' tables. At this point the user should update any
information if so desired, then click on "Submit" at the bottom of the
page to update the table and go on to the next page of the form. This
causes the same page to reload, validation is run, and if it passes it
again reloads the page only this time it sets a flag to write a <meta>
redirect tag to the page. The page is reloaded but instantly
redirected to the next page (I couldn't use "header()" because the
headers are already written).

The validation script is part of the same document. There is an IF
statement at the head of the validation portion - if
($_SERVER['REQUEST_METHOD'] == 'POST'). This should, in theory,
prevent the script from running a retrieved 'open session' through the
validation, at the end of which if everything passes validation the
data for that session is updated (or if it is a new
session ,inserted). It should only be invoked if someone presses the
"Submit" button at the bottom of the page, which is set to "POST". So
in theory, the validation should only be run when "submit" is clicked
by the user, not when an open session is selected and "submit" is sent
by the 'onChange' javascript.

What's going screwy is that the open session's request method is
coming back as "POST" even though it is explicitly set as "GET". So
when an open session is retrieved, the page reloads, the validation is
run, everything checks out so the data is updated and the browser
loads the next page, without the user getting the opportunity to
update any of the retrieved open session's data.

I hope I have explained this clearly. Can someone tell me why the
first submit - the one for the drop-down menu of open sessions - is
returning POST even though it is set to GET? This is screwing
everything up and I can't figure a way around it.

May 9 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Michael Brennan-White | last post by:
If I submit my for using a get action the resulting page loads . If I use a post action I get an error page saying "The page cannot be found". I am calling the originating page!!! This happens...
10
by: Gregory A Greenman | last post by:
I'm trying to write a program in vb.net to automate filling out a series of forms on a website. There are three forms I need to fill out in sequence. The first one is urlencoded. My program is...
32
by: Eli | last post by:
How can I POST a form into a new window where I control the size and other attributes of the new window? Also. Are there any implications, perhaps due to browser security (Interne Explorer?)...
10
by: iam247 | last post by:
Hi In my prototype asp page (with no javascript and no password validation, I have a registration form with the following action: <form name="form" method="post" action="RegDetails.asp"> ...
2
by: Myk Quayce | last post by:
I have a small .aspx page that uses old style forms with client-side JavaScript validation. Everything works fine until I try to upate the database with some new information. I must be doing...
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
7
by: Mark Waser | last post by:
Hi all, I'm trying to post multipart/form-data to a web page but seem to have run into a wall. I'm familiar with RFC 1867 and have done this before (with AOLServer and Tcl) but just can't seem...
1
by: Muchach | last post by:
Hello, Ok so what I've got going on is a form that is populated by pulling info from database then using php do{} to create elements in form. I have a text box in each table row for the user to...
4
by: Ronald Raygun | last post by:
I have a form on an HTML page with the usual user name, email etc. I want to be able to display a popup window (callout?) when a text input control element is clicked. For example, for the form:...
1
by: starter08 | last post by:
Hi, I have a C++ routine(client-side) which uploads an xml file to a web server by making a socket connection and sending all the post request through that socket. On the server side I have a cgi...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.