473,836 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

REQUEST_METHOD vs REDIRECT_REQUES T_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_REQUE ST_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_REQUES T_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 4322
On Jun 12, 10:20 am, alex <m...@privacy.n etwrote:
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_REQUE ST_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_REQUES T_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_REQUES T_METHOD.

Jun 12 '07 #2
En/na ma*********@goo glemail.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_REQUES T_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
12593
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 the page: Notice: Undefined index: REQUEST_METHOD in \www\search\libs\utils.php on line 409 I have enclosed the code it refers to below. I am an amateur when it comes
1
1829
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 /techdocs/.htaccess file: ErrorDocument 401 /forms/registration.cgi Require valid-user
3
2305
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 patch but the patch is still sitting there in limbo. This is the first patch I have submitted for Python, did I miss a step in the patch process? What else needs to be done?
1
2351
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 : Server : WEB System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an
16
3156
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 only when the form is submitted <%@LANGUAGE="VBSCRIPT"%> <% Set MyMail=CreateObject("CDO.Message")
6
17530
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
1277
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: <?php $request_method = $_SERVER;
0
1192
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 have a problem. When I use a 32-bit build of the CGI script, everything works swimmingly. But when I use a 64-bit build of the CGI script, GetEnvironmentVariable() throws a System.Security.SecurityException saying it doesn't have permission to...
7
16172
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 the domain name www.blog-start.com Unfortuantely it is not not working correctly
0
9654
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
10818
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...
0
10526
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10565
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,...
1
7770
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
5809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4436
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
3999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3094
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.