Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9000267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:17:24+00:00 2026-06-16T00:17:24+00:00

I am very curious on why when I print_r($this->input->post()), it prints an array and

  • 0

I am very curious on why when I print_r($this->input->post()), it prints an array and then has 1 after it.
This is what it prints:

Array ( [username] => lilmousiee [birthdate] => 1992-04-26 [gender] => 1 [password] => 66lah66lab [password2] => 66lah66lab [pin] => 2323 [pin2] => 2323 [email] => mouseywings@live.com [email2] => mouseywings@live.com [region] => 1 [dtype] => air [dname] => Mattyco [dgender] => 1 [terms] => [recaptcha_challenge_field] => 03AHJ_VutHNI6hK3M_trpE-n4Qr9V5wWSH10p8hmQjrYVLeWf65ylIDva5XdH78uGED5KCsMx8tp3FHZ6p1xTllyrdSP7nEbnSILQ9CDqrxoD2pit5o9T9Cowy06_O6XLLM22fvH_5ICqoYrmI-o-P8dGCal0fNKuSohgvFU03FmgbhuYTDjJ_xUA [recaptcha_response_field] => asdfsadf [submit] => Register [search] => [type] => usersitems ) 1

Why is it printing that “1” after the array? I do not have one even typed… And there is no input field that does a value of 1 after the register button… And what exactly is the “search” and “type” keys?

The last part of my HTML:

    <legend>Terms of Use</legend>
    <div id="terms">
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris vitae turpis ut sem tristique luctus. Sed tincidunt consequat tristique. Mauris laoreet vestibulum aliquam. Ut enim tortor, aliquet at faucibus sed, venenatis eget tellus. Praesent velit nisl, bibendum a dignissim nec, hendrerit non lacus. Fusce dapibus pharetra molestie. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris vitae turpis ut sem tristique luctus. Sed tincidunt consequat tristique. Mauris laoreet vestibulum aliquam. Ut enim tortor, aliquet at faucibus sed, venenatis eget tellus. Praesent velit nisl, bibendum a dignissim nec, hendrerit non lacus. Fusce dapibus pharetra molestie. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris vitae turpis ut sem tristique luctus. Sed tincidunt consequat tristique. Mauris laoreet vestibulum aliquam. Ut enim tortor, aliquet at faucibus sed, venenatis eget tellus. Praesent velit nisl, bibendum a dignissim nec, hendrerit non lacus. Fusce dapibus pharetra molestie. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris vitae turpis ut sem tristique luctus. Sed tincidunt consequat tristique. Mauris laoreet vestibulum aliquam. Ut enim tortor, aliquet at faucibus sed, venenatis eget tellus. Praesent velit nisl, bibendum a dignissim nec, hendrerit non lacus. Fusce dapibus pharetra molestie. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>
    </div>
    <?php echo form_checkbox(array('name' => 'terms')); ?> Accept Terms of Use
    <div class="row clearfix">
        <?php
          echo recaptcha_get_html($public_key);
        ?>
    </div>
</fieldset>
<?php echo print_r($array); ?>

<div class="row clearfix"><?php echo form_submit('submit', 'Register'); ?></div>
<? echo form_close(); ?>

I’m just having trouble passing $this->input->post() array into a validation function. Here is MY_Form_validation.php in my libraries folder:

class MY_Form_validation extends CI_Form_validation {
    private $post;

    public function __construct($params = array()) {
        foreach($params as $param) {
        parent::__construct($param['config']);
$this->post = $param['post'];
        }

    }
}

Is there a reason that “1” is being printed as the $this->post value… When it should hold the key and values of the array?
This is how I’m passing the parameters:

$this->load->library('MY_Form_validation', array('config' => '', 'post' => $this->input->post()));

But when I put print_r($this->post), it only prints “1”..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:17:24+00:00Added an answer on June 16, 2026 at 12:17 am

    It’s because $this->input->post() is an object and not a string or an array. It’s printing out 1 because the object exists and has properties. If it did not exist or was empty, it would print 0. It’s just a numerical representation of the boolean return value.

    As someone mentioned, if you do var_dump($this->input->post()) you won’t have the “1” character showing up.

    To get the value of a field, specify the fieldname in the parentheses:

    $recaptcha_data = $this->input->post('recaptcha_challenge_field');
    

    Another clarification; You can use $this->input->post()‘s return value like this:

    if ($this->input->post()) 
    {
        // do stuff if post array exists
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just very curious if somebody has same problem as me. Every time I
I just learned about comet pattern(Long polling) and very curious to implement a simple
I can't find if it is or not and am very curious - if
I've always been curious: how can I perform arithmetic operations on very long decimals--for
Very simple question... I have an array of pixels, how do I display them
Very new to python and can't understand why this isn't working. I have a
Very simple question: Specifically in Python (since Python actually has strongly recommended style guidelines
I am very curious in messing up with HW. But my top level messing
Curious if anyone has opinions on which method would be better suited for asp.net
This is a homework if anyone's curious. The task is to have a C

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.