Welcome Guest, Not a member yet? Register   Sign In
set_value() with redirect() issue
#1

[eluser]veledrom[/eluser]
Hi,

I cannot use set_value() in my forms because I'm using redirect(). Is there any way of using it along with redirect()?

echo set_value('text_username'); doesn't work.

Thanks


do_login() METHOD
Code:
if ($this->form_validation->run() === true)
{
   redirect('good_job');
}
else
{
   $this->session->set_userdata('validation_errors', validation_errors());
   //Stay in same page and print errors there
   redirect('login');
}

login PAGE
Code:
<h3>Login</h3>


&lt;?php
//** Print form validation errors
if ($this->session->userdata('validation_errors'))
{
   echo $this->session->userdata('validation_errors');
}
?&gt;



<div id="div_box">
&lt;?php echo form_open('login/do_login'); ?&gt;

Username : &lt;input type="text" name="text_username" value="&lt;?php echo set_value('text_username'); ?&gt;" /&gt;
<br /><br />
Password : &lt;input type="password" name="text_password" value="" /&gt;
<br /><br /><br />
&lt;input type="hidden" name="hidden_form_hash" value="&lt;?php echo $form_hash; ?&gt;" /&gt;
&lt;input type="submit" name="submit_button" value="Login" /&gt;

&lt;?php echo '&lt;/form&gt;'; ?&gt;
</div>


Messages In This Thread
set_value() with redirect() issue - by El Forum - 05-14-2012, 05:40 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 05:45 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 05:47 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 05:51 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 06:30 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 06:31 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 06:34 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 07:19 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 08:20 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 08:41 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 08:42 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 08:50 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 09:16 AM
set_value() with redirect() issue - by El Forum - 05-14-2012, 09:19 AM
set_value() with redirect() issue - by El Forum - 02-08-2013, 12:47 PM
set_value() with redirect() issue - by El Forum - 02-08-2013, 01:29 PM
set_value() with redirect() issue - by El Forum - 02-08-2013, 02:41 PM
set_value() with redirect() issue - by El Forum - 02-08-2013, 05:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB