No, I don’t intend to have the site locked on page id 68, that was just a test in an attempt figure out what was going on in my code. Ideally I would just have:
$_REQUEST[’id’] = $_POST[’pageid’];
in the if block, which you can see is commented out there. This is what I’m trying to do:
I’m using the PEAR HTML_QuickForm_Controller, which lets me build forms with Wizard type functionality and validation. The HTML for the form is generated dynamically, including the action attribute in the <form> tag. I have no way of inserting the &id=68 into the action using PHP code. But I can insert hidden <input> tags into the form and in this case, I have one named "pageid" containing the id of the MODx page. Thus I would ideally end up with (if it worked as it should) something like this:
if (isset($_POST['pageid']))
{
$_REQUEST['id'] = $_POST['pageid'];
}
I would have liked to do this in a plugin, but as garryn said, there are no events that fire early enough to be able to override the page ID in $_REQUEST.
The thing that is so strange is that it breaks when I alter the $_REQUEST from inside if block. If I alter it before the if block, it works fine. It IS getting into the if block and ’pageid’ IS getting posted. I thought it could be a scope problem, but no... my mind is made up...
I’m living in the twilight zone.