cannot user redirect() function.. |
[eluser]Tpojka[/eluser]
[quote author="scorpioniz" date="1410625708"] if you would see my code in first post there is commented line with redirect, and if I uncomment it and run it - it's redirecting to page perfectly.. :/ but not at the end of else statement.. :///[/quote] Can we asume that else block is not executed at all? Again your code: Code: <?php if ( ! defined('BASEPATH') ) exit('No direct script access allowed'); Seems like else block is not executed at all, and your redirect function is just in it (already said).
[eluser]Tim Brownlaw[/eluser]
Well scorpioniz insists that the insert and updates are working indicating that execution is falling into the else block... Which I find a little hard to believe with the provided code sample as $data doesn't exist locally in the function and I cannot see where it's being defined. So it's obvious that IF the else block is being executed somethings going BANG halting execution... Or the redirect would be getting executed... We're flying blind here! So A Quick check would be to do this... Code: <?php if ( ! defined('BASEPATH') ) exit('No direct script access allowed');
[eluser]scorpioniz[/eluser]
[quote author="Tim Brownlaw" date="1410660500"]Well scorpioniz insists that the insert and updates are working indicating that execution is falling into the else block... Which I find a little hard to believe with the provided code sample as $data doesn't exist locally in the function and I cannot see where it's being defined. So it's obvious that IF the else block is being executed somethings going BANG halting execution... Or the redirect would be getting executed... We're flying blind here! So A Quick check would be to do this... Code: <?php if ( ! defined('BASEPATH') ) exit('No direct script access allowed'); sorry.. that i didn't put all my code.. :? i thought it will be easier to read.. but still nothing helping.. event if in else it is Code: $event_id = 1; it starts to load show page but later it still opens edit page.. so here is my all code of that function.. ![]() Code: function edit($id = NULL, $test = null){ and i have made screenshots of my sql, and developer tools network tab with some comments in it, i hope it will help something.. :/ Screenshot
[eluser]scorpioniz[/eluser]
well i did work around for this.. i made ajax call for submiting my form in view.. and then i check.. if i get $event_id an integer, i redirect to show page with Code: location.href = "<?=site_url('user/event/show');?>/"+event_id;
[eluser]Tim Brownlaw[/eluser]
Can you clarify this point... Quote:it starts to load show page but later it still opens edit page.. Does that mean that you start to see your "show page" but then it's redirecting to your "edit page"? Or am I totally missing what the issue is here?
[eluser]InsiteFX[/eluser]
Begging to sound like the old session problem with ajax. |
Welcome Guest, Not a member yet? Register Sign In |