Welcome Guest, Not a member yet? Register   Sign In
problem passing POST values
#1

[eluser]bret[/eluser]
I've been reading multiple forum posts about this but cannot seem to figure out my issue. I'm trying to pass POST values to my controller. I've tried removing my .htaccess just to see if it will work without, but no luck. The profiler output is below, and shows the post data of my submit button, labeled Register. My base url has the "/" at the end.

Anyone have any suggestions for me? Smile


View code:
Code:
<?php echo form_open('index.php/register/process_register') . "\n"; ?>
                    <?php echo form_fieldset('Register') . "\n"; ?>

                        <?php echo $this->session->flashdata('message'); ?>
                        
                        <p><label for="email_address">Email Address: </label>&lt;?php echo form_input($email_address); ?&gt;</p>
                        <p><label for="password">Password: </label>&lt;?php echo form_password($password); ?&gt;</p>
                        <p><label for="verify_password">Verify Password: </label>&lt;?php echo form_password($verify_password); ?&gt;</p>
                        <p>&lt;?php echo form_submit('register', 'Register'); ?&gt;</p>
                    &lt;?php echo form_fieldset_close(); ?&gt;
                &lt;?php echo form_close(); ?&gt;


Controller code:
Code:
$email_address = $this->input->post('email_address');  
$password = $this->input->post('password');


Profiler output:

POST DATA
$_POST['register'] Register

I also did a print_r($_POST); and got the same result of just the Register button.

Anyone know why I get the POST data for the submit button, but not for the email_address and password fields?
Thanks in advance. Smile
#2

[eluser]WanWizard[/eluser]
Read the section in the user guide about Form helpers. You'll find that you need to include at least a fieldname when calling functions like "form_input".
#3

[eluser]bret[/eluser]
I guess that's what happens when I try to stay up until 5am writing code. lol Thanks for finding my ridiculous error.




Theme © iAndrew 2016 - Forum software by © MyBB