473,395 Members | 1,977 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,395 software developers and data experts.

REQUEST_METHOD vs REDIRECT_REQUEST_METHOD

I'm building a Resty interface and i'm trying to POST data from a web
page via a normal web form with method="POST" in it's form tag.

When i submit the data to my resource the variable
$_SERVER["REQUEST_METHOD"] reports "GET" and there is a
$_SERVER["REDIRECT_REQUEST_METHOD"] which reports "POST".

The resource pages are accessed using the apache 404 error page:

- The web page gets the request (http://myserver/path/to/my/resource)
- The url it's not found and the url string is parsed
- The resource /path/to/my/respurce is checked
- The resource data is returned

So, do i have to use the REDIRECT_REQUEST_METHOD server variables
instead of REQUEST_METHOD??

Is it a reliable variable?? (i.e all web servers produce this variable
when accessing a resource in this fashion)

thanks,
alex.
Jun 12 '07 #1
2 4261
On Jun 12, 10:20 am, alex <m...@privacy.netwrote:
I'm building a Resty interface and i'm trying to POST data from a web
page via a normal web form with method="POST" in it's form tag.

When i submit the data to my resource the variable
$_SERVER["REQUEST_METHOD"] reports "GET" and there is a
$_SERVER["REDIRECT_REQUEST_METHOD"] which reports "POST".

The resource pages are accessed using the apache 404 error page:

- The web page gets the request (http://myserver/path/to/my/resource)
- The url it's not found and the url string is parsed
- The resource /path/to/my/respurce is checked
- The resource data is returned

So, do i have to use the REDIRECT_REQUEST_METHOD server variables
instead of REQUEST_METHOD??

Is it a reliable variable?? (i.e all web servers produce this variable
when accessing a resource in this fashion)

thanks,
alex.
Global variables should ever be reliable! I think since PHP 5.1.6 you
can trust them.
If you work with redirection you should use the
REDIRECT_REQUEST_METHOD.

Jun 12 '07 #2
En/na ma*********@googlemail.com ha escrit:
>
Global variables should ever be reliable! I think since PHP 5.1.6 you
can trust them.
If you work with redirection you should use the
REDIRECT_REQUEST_METHOD.
I was not refering about reliable in a "security" sense but in:
will the variable exist if someone uses the application under a IIS (for
instance) instead of Apache.

BTW, i learned the hard way that ErrorDocument redirection does not keep
$_POST variables you sent, so i've got to redesign server configuration
to use mod_rewrite which will make things easier for me.

thanks anyways :)
alex.

Jun 12 '07 #3

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

Similar topics

6
by: Bandit | last post by:
Hi there, I have installed a search engine on one of my websites - it had a few bugs in it, I got all but one out of the script. The results page works, but it displays this error on the top of...
1
by: Austyn Bontrager | last post by:
Should cgi.FieldStorage examine the environment variable REDIRECT_REQUEST_METHOD before examining REQUEST_METHOD? I'm running Apache, and write my CGI scripts in Python. I have this in a...
3
by: Joe | last post by:
Back in March I submitted a patch for cgi.py to sourceforge to fix a problem with the handling of an invalid REQUEST_METHOD. I thought I followed all the steps to properly submit the bug and...
1
by: Ersin Gençtürk | last post by:
We couldn't find why these errors happen.They doesn't appear everytime.And they appear different pages at different times.Is there somebody know why these happenes ? First user gets this error :...
16
by: whyyyy | last post by:
The script below works fine if the form is filled out and submitted. But a (blank) e-mail is sent whenever the page loads, even when the form is not submitted. I would like to receive the e-mail...
6
by: rynato | last post by:
whatever code I put inside this IF statement: if ($_SERVER == 'POST') I get a parse error. Even 'print "something goes here"' doesn't work. Any ideas?
2
by: itamtodd | last post by:
Ok so I am mr.Knownothing when it comes to scripting... I am trying to modify this script to omit fields that are not filled in. I have checkboxes and text fields. Here is my current script: ...
0
by: Graham | last post by:
I'm trying to write a CGI script in C#; it receives data from an HTML form via the POST method, and tries to read the form data using System.Environment.GetEnvironmentVariable(). Which is where I...
7
by: jeddiki | last post by:
Hi, As I am in Turkey at present, I can not see vidoes on youtube. So I have tried a few proxies but keep finding them slow or not working. So I have installed myphpProxy on my server under...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
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,...

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.