GET_POST_Var - Free ExpressionEngine Add-On

ee.png

GET_POST_Var is a free ExpressionEngine Plug-In that provides some helper functions for fetching data like GET, POST, User IP, User Agent, Cookies and Server Variables.


Description

GET_POST_Var is a free ExpressionEngine Plug-In that provides some helper functions for fetching data like GET, POST, User IP, User Agent, Cookies and Server Variables.

For available Server Variables please see PHP Variables section in PHP_Info. (CP -> Utilities -> PHP Info)

GET_POST_Var 1.x is compatible with the NSM Addon Updater.

Usage

To use this Plug-In, put this tag in your template and set up 'type' and 'var'.

{exp:get_post_var type='get' var='variable_name'}

Variables - Supported Types/Pairs

NOTE: If the specified variable isn't found, an empty string is returned.

Examples

Reads the value from a variable 'var1' set by a GET request like 'example.com/blog/entry?var1=12345'
results in: 12345

{exp:get_post_var type='get' var='var1'}

Reads the ExpressionEngine 'exp_tracker' cookie
results in: {"0":"blog/get_post_var_free_expressionengine_add_on","1":"blog","token":"7633ec2ac98a8173979cd8906799f488"}

{exp:get_post_var type='cookie' var='tracker'}

Comparing a returned value:

{if "{exp:get_post_var type='user_ip'}" == "127.0.0.1"}
    YES, it is 127.0.0.1
{if:else}
    NO, it is not 127.0.0.1
{/if}

Installation

ExpressionEngine 2.x

  1. Place the GET_POST_Var folder in your sites ./system/expressionengine/third_party/ directory.

ExpressionEngine 3.x

  1. Place the GET_POST_Var folder in your sites ./system/user/addons/ directory.
  2. Go to the Add-On Manager in the ExpressionEngine control panel, find GET_POST_Var in the list, and click Install.

Changelog

License

GET_POST_Var Copyright (C) 2010 - 2016 Ingo Wedler.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/gpl-3.0.

Downloads

Download GET_POST_Var 1.1 NOW! (Compatible with ExpressionEngine 2.x)

Download GET_POST_Var 2.0 NOW! (Compatible with ExpressionEngine 3.x)