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

Help getting $_POST data field names for entry

Development and Programming

Silencio's avatar
Silencio
46 posts
18 years ago
Silencio's avatar Silencio

I’m new to EE and extensions.

I’m trying to write an extension to be added in a field underneath the Body field inside the Publish screen. I’ve had success getting the extension set up and running… though I’m having trouble with the final stage of the extension… which is inserting to the db. What I am unsure of is the specific calls of some of the $_POST data from the other fields from the Publish screen. Like the Title field, Date fields, body fields… how can I get access (correct syntax) to them in my process form file function.

For instance… if i wanted to access the Entry Date, would I get the string by:

$need_date = $_POST['entry_date'];

// or

$need_date = $_POST['field_list_items']['entry_date'];

// I'm unsure

Any help would be appreciated.

Thanks.

       
gabrys's avatar
gabrys
6 posts
18 years ago
gabrys's avatar gabrys

use global keyword:

global $_POST;

and then access $_POST

but consider using:

global $IN;
$IN->GBL('entry_date', 'POST');
       
Derek Jones's avatar
Derek Jones
7,561 posts
18 years ago
Derek Jones's avatar Derek Jones

$_POST is a Super Global so that’s not necessary, gabrys, but you’re right that it can sometimes be advantageous to use $IN->GBL().

Silencio, if you want to see the structure, in your extension just use a little debugging code

print_r($_POST);

and all will be revealed!

       

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.