Exactly why this occurs is beyond the capabilities of my tiny brain, and I’d really appreciate one of you gurus out there to post what the reason for this is, but in the interim I’m posting this here because I’ve had this issue twice now and it might save someone else a bit of stress 😊
Removing the index.php from the URI is great for SEO, but if you’re creating a ‘normal’ HTML form with the standard syntax of:
<form id="form_name" method="POST" action="url/to/my/next/file" />
be aware that the url in the action needs to INCLUDE the index.php. Otherwise, the form you’re aiming at, to do something wonderful with your POSTed variables will look blankly at you and wonder why you’re shouting at it. The POST array will be empty.
My thought was that the URI would be parsed by the .htaccess file when a new webpage was ‘called’ by such an internal link. However, this doesn’t seem to be the case.
Put the index.php back in the stated URI and hey presto the POST array is populated in the receiving page.
I’m using LG .htaccess Generator to remove the index.php in the URI (using the default extension settings) and I don’t know whether this is an EE thing or an LG thing, but I’m guessing it’s the way EE deals with POST requests.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.