We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

POST array is empty with SEF URIs?

Development and Programming

PositionOne's avatar
PositionOne
57 posts
16 years ago
PositionOne's avatar PositionOne

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.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.