php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27389 $_POST variables not accessible from multiview
Submitted: 2004-02-24 23:55 UTC Modified: 2004-03-06 14:24 UTC
From: vanlei at yahoo dot com Assigned:
Status: Not a bug Package: Apache related
PHP Version: 4.3.4 OS: Mac OS X
Private report: No CVE-ID: None
 [2004-02-24 23:55 UTC] vanlei at yahoo dot com
Description:
------------
$_POST variables aren't accessible from within a 
multiview if one configures the action of a form to be 
the child of a multiview.

In other words, If I set the action of a form to be 
'example.com/multi/sub' where multi is a PHP file 
called multi.php that catches the url 'example.com/
multi/sub/' (by using apache's multiviews), multi.php 
will not have access to the $_POST variable.

It works if one sets the action as 'example.com/multi/
'.

Reproduce code:
---------------
Example code:

<form method="post" 
 action="http://example.com/multi/sub/" 
 name="form">

     <input 
     type="submit" 
     name="submit" 
     value="Value" />   
</form>


multi.php:

echo $_POST['submit']

Expected result:
----------------
Expected:

$_POST['submit'] == "Value"

Actual result:
--------------
Blank. I think PHP associates the $_POST variable with 
/multi/sub when sub isn't a script/file. Instead the 
request is handled by multi.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-25 05:56 UTC] sniper@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


Apache version, how to configure httpd.conf, how PHP is configured (module/cgi), etc.
 [2004-02-25 21:31 UTC] vanlei at yahoo dot com
Apache: Server version: Apache/1.3.29 (Darwin)

httpd.conf:

Inside the config for the site, you need to add:

<Directory "/site/to/www">
        Options MultiViews
</Directory>

PHP is configured as an apache mod. Version 4.3.4
 [2004-02-26 06:00 UTC] postings-php-bug at hans-spath dot de
You should perhaps reread the Apache documentation. As far as I understand it, Multiviews are used for automatic language selection and aren't involved in your problem.

I've run some tests with http://my-server/script.php/morestuff/ using GET and POST requests.

Linux, Apache 2, PHP 4.3.4 module: works
Windows, Apache 2, PHP 4.3.4 module: works
Windows, Apache 2, PHP 4.3.4 CGI: doesn't work (maybe misconfiguration)

And it works even with MultiViews disabled.

Although I haven't tested Apache 1, I don't think there is a PHP problem.

Try if a normal GET request works on such URLs, and if it doesn't, it might be a problem with your apache configuration.
 [2004-03-01 12:46 UTC] vanlei at yahoo dot com
I traced the problem a little better. I wasn't coming 
in through the overriden php file, but through 
ErrorDocument. Now I'm not sure if it is a bug or not, 
but ErrorDocument doesn't see POST. In any case I 
solved it in a more elegant way, but I'll leave this 
here for comment. Should ErrorDocument receive POST 
requests?
 [2004-03-06 14:24 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The POST & GET data does not get passed to the 
ErrorDocument handler, only the missing URL is. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 07:01:29 2024 UTC