Welcome Guest, Not a member yet? Register   Sign In
Codeigniter Form POST Question
#1

On my login controller I redirect to my dashboard if form success. But when I redirect it to my dashboard controller I cannot get post data

I use var dump on my login controller

var_dump($_POST);
exit;

And I can see post data then


I try to use <?php echo $this->input->post('username');?> on dashboard after forum success 

Most of the time I use $this->session->userdata('username') but would like to know why after been redirected can not echo post username

I know its a basic php question but would be good to know.
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply
#2

If you just want to write "Hello, username" after login, you may pass the username with flash-data.
Reply
#3

(06-21-2015, 10:28 PM)riwakawd Wrote: I know its a basic php question but would be good to know.

It doesn't have anything to do with PHP actually ... An HTTP redirect means that the client makes another HTTP request, this time a GET one, and it doesn't resubmit the POST data from the previous request.
Reply
#4

(This post was last modified: 06-22-2015, 12:49 AM by wolfgang1983.)

(06-22-2015, 12:22 AM)Narf Wrote:
(06-21-2015, 10:28 PM)riwakawd Wrote: I know its a basic php question but would be good to know.

It doesn't have anything to do with PHP actually ... An HTTP redirect means that the client makes another HTTP request, this time a GET one, and it doesn't resubmit the POST data from the previous request.

Thank you @Narf good answer
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB