![]() |
Very weird array problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Very weird array problem (/showthread.php?tid=29801) |
Very weird array problem - El Forum - 04-21-2010 [eluser]frist44[/eluser] I have created a few applications using some similar methods and found some issues with this particular one that I was never able to pinpoint. I have a view function that showing some information about an upload. I do a check to see if info exists for that particular ID, and if it doesn't, redirect to a different page, which in turn shows some message based on flash data in the session library. Code: public function view($uploadid = FALSE) { So when I first go to the page, everything looks normal, if I refresh the page, I get the error message showing as though the condition if (empty($data['upload'])) is satisfied however it doesn't do the redirection, just shows the message. That's the only place that message is referenced, so it has to be from that call. Any idea???? Very weird array problem - El Forum - 04-21-2010 [eluser]vitoco[/eluser] Code: public function view($uploadid = FALSE) { Saludos Very weird array problem - El Forum - 04-22-2010 [eluser]frist44[/eluser] [quote author="vitoco" date="1271907971"] Code: public function view($uploadid = FALSE) { Saludos[/quote] The functions are helpers that I have created that indeed take 2 arguments. Here is one: Code: if (!function_exists('redirect_with_error')) Also, the code doesn't need an exit because it's not even getting into that loop, or else the whole page would redirect. It has something to do with flash data being set outside of that conditional statement, but I'm baffled. Very weird array problem - El Forum - 04-22-2010 [eluser]vitoco[/eluser] there's an extra ; in the function Code: if (!function_exists('redirect_with_error')) i hope it works now Saludos Very weird array problem - El Forum - 04-22-2010 [eluser]frist44[/eluser] [quote author="vitoco" date="1271988402"]there's an extra ; in the function Code: if (!function_exists('redirect_with_error')) i hope it works now Saludos[/quote] That was a copy/paste error. Keep in mind that nothing gives an error. The syntax is right, so looking for textual errors is probably not the best approach. Very weird array problem - El Forum - 04-22-2010 [eluser]vitoco[/eluser] [quote author="frist44" date="1271988531"] That was a copy/paste error. Keep in mind that nothing gives an error. The syntax is right, so looking for textual errors is probably not the best approach.[/quote] How do you get and extra ; in a copy paste ??? , well...i'll try to take other approach. Saludos Very weird array problem - El Forum - 04-22-2010 [eluser]Federico BaƱa[/eluser] If the flash data is being set successfully the problem must be in the helper.. I'd try placing the redirect over the set_flashdata and check if setting the location header before the session works fine.. |