• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to handle request method post fields

#1
[eluser]Xavier D.[/eluser]
Hi,

I have an issue with a login system.

The login form is available on every page (menu dropdown).

I have a controller "user" with a function "login" to handle the post vars.

The problem is that I need to submit the form to user/login, the login function handles everything and does a redirect to the previous page, looks lide 2 redirections.

1) page -> /user/login 2) /user/login -> previous page

It is working, no problem, but I have a flash with the redirect, not very nice I think.

Is there a solution? So we can handle the post vars, not in the view offcourse. But on another way, whitout the refresh?

thx!

#2
[eluser]Xavier D.[/eluser]
I see the codeignitor site is also doing some redirection when logging in and out.

Seems like there is no other way?

#3
[eluser]Colin Williams[/eluser]
Just do a 'location' redirect:

Code:
redirect('previous/page', 'location');

And use Session flashdata to store messages so that they persist across HTTP requests.

#4
[eluser]Xavier D.[/eluser]
thx! works like a charm Smile


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.