Home » HTML » HTML_QuickForm_Controller » Bug #1809
class doesn't work with mod_rewrite
Details
| Submitted | 2004-07-06 18:25 UTC |
|---|---|
| From | thanos dot a at fastwebnet dot it |
| Status | Bogus |
| Package | HTML_QuickForm_Controller |
| PHP Version | 4.3.7 |
| OS | Fedora Linux Core 1 |
| Roadmaps | (Not assigned) |
Comments
[2004-07-06 18:25 UTC] thanos dot a at fastwebnet dot it
Description:
------------
It seems that HTML_QuickForm_Controller doesn't work with mod_rewrite enabled websites.
My website is using mod_rewrite to do url rewriting like this:
requested url:
http://www.domain.com/value/page
rewrited url:
http://www.domain.com/index.php?v=value&p=page
but since it itsn't possible to specify any action in the constructor of HTML_QuickForm_Page I would like that the action of the form would be _SERVER["REQUEST_URI"] (not PHP_SELF) ... don't know if this is really a bug.
I'm using the latest release of HTML_QuickForm_Controller.
Any help would be appreciated.
Reproduce code:
---------------
No need to post code.
Expected result:
----------------
Form submitted to http://www.domain.com/value/page
Actual result:
--------------
Form submitted to http://www.domain.com/index.php (with no url parameters)
[2004-07-08 18:04 UTC] thanos dot a at fastwebnet dot it
I tried the updateAttributes method, it works until succesful validation of the 1st page, then, when the submit action has been called, the url changes to http://www.domain.com/value/page?_qf_page2_display=true but the page shows always the 1st form
[2005-03-02 19:10 UTC] sergio dot carvalho at portugalmail dot com
This bug is *not* bogus. If I understand the intent of the action attribute default setting, the objective is to submit the form to the same page. When using URL rewriting, PHP_SELF is not guaranteed to point to anything resembling the page URI. It might point to an invalid URI altogether.
Example:
RewriteRule ^games\/categorylist/ [forbidden]
RewriteRule ^games\/(.+)/ /games/categorylist/?gamescategory=$1 [qsa,last]
When accessing /games/somecategory/, PHP_SELF will be /games/categorylist/index.php while REQUEST_URI will be /games/somecategory/. REQUEST_URI should be used.
Beware that REQUEST_URI contains the query string, which should be stripped before being used as an action. Something like preg_replace('/([^?]*)\?.*/', '\${1}', $_SERVER['REQUEST_URI'])
[2006-05-29 22:26 UTC] sigmund dot lahn at gmail dot com
sergiocarvalho,
updateAttributes() will not help if you call it from the buildForm() method. Try calling it from the code where you create the page object.