I'm trying to implement this password protected content method on a v2.1.3 build.

This code...

global $IN;

if ( ! $the_password = $IN->GBL('the_password', 'POST') ) :


...returns an error

Fatal error: Call to undefined method EE_Input::GBL() in  /homepages/42/d186459053/htdocs/dri/expressionengine/libraries/Functions.php(650) : eval()'d code on line 17

After some research, it looks like part of this has been deprecated.

Instead I should be using...


However, after reading this, it looks like the

global ee() function is only available since EE 2.6.0

Upgrading EE at this time isn't an option. What could I do to to retrieve the POST variable in this instance so this method works?

3 Answers 3


The ee() function in 2.6+ is just a shortcut to another function, get_instance(), which appears in ALL versions of EE.

$EE =& get_instance();
if ( ! $the_password = $EE->input->post('the_password') ) :

So the correct answer to your question is the correct global ee() function for the version of EE you named is...

$this->EE =& get_instance();

$this->EE // is the 2.6+ ee() equivalent.


Managed to get it working with the following code

<?php if (! $the_password = $this->EE->input->post('the_password')) : ?>

<form action="" method="post">
  Enter your password:<br/>
  <input type="password" name="the_password" value="" id="the_password" />
  <input type="submit" name="submit" value="Access Content &rarr;" id="submit" />
<?php else : ?>
{exp:channel:entries channel="private_content" 
 url_title="<?php echo $the_password;?>" 
 dynamic="off" limit="1"}

 {if no_results}<p>Your password is incorrect. Would you like to
    <a href="{path='private'}">try again</a>?</p>{/if}


<?php endif; ?> 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.