how to put dynamic info in an array? |
[eluser]JHackamack[/eluser]
This seems like a really strange behavior for a redirect not to work. Are you sure that you aren't outputting anything. Also are your links working on the site (aka can you navigate around and only the header redirects aren't working)
[eluser]dadamssg[/eluser]
yeah everything seems to be working except THIS redirect...other ones are working fine. and yeah im sure my 'page' session variable is holding value because im echoing it out into a view
[eluser]JHackamack[/eluser]
so if you say: echo $page; die(); what result does it give you Also before you mentioned trying the header option, but it wasn't working, what exactly did you try?
[eluser]JHackamack[/eluser]
Are you echoing anything before the redirect? or print_r()ing anything?
[eluser]dadamssg[/eluser]
not echoing anything before....i have a login in my header on every page. so the idea is to hold what page im on in a session variable so i can use that in my login controller/script. It works in one controller but not in another i tried this header("location: http://mysite.com/$page"); heres the relevant login code in its own separate controller Code: $this->validation->set_rules($rules); heres whats in another controller that works Code: function index($page = null) Code: $row = $data['query']->row();
[eluser]JHackamack[/eluser]
When you say it does not work are you implying that it never redirects correctly? Never seems to set the variable, or never gets to your "Query" (are you sure the query is triggered successfully?) Have you enabled error reporting error_reporting(E_ALL); ini_set('display_errors',1); Also, im not sure if its caps sensative, but could you try header(“Location: http://mysite.com/".$page); Im just running through a list of options I would try and make sure everything is correct.
[eluser]Dyllon[/eluser]
I may have missed it but what exactly is the type of error you are receiving from this? Is your event controller throwing an error or are you receiving a 404 or are you being redirected to your login page? What happens when you try to access the events page (mysite.com/event/index/867) when logged in? You've got bits and pieces of your code spread over numerous posts, I recommend posting your entire controllers that are involved. Code that you may think is irrelevant may not be.
[eluser]WebsiteDuck[/eluser]
Like Dyllon said, try accessing the page directly from your browser. If redirect and header don't work, but they work for other controllers, its probably a problem with your event/index, can you post that code?
[eluser]dadamssg[/eluser]
heres my event/index. i am being redirect back to my mains/index controller everytime Code: <?php
[eluser]Flemming[/eluser]
surely your problem is in this IF ... Code: $yes = $this->Eventmodel->get_exists($id); presumably $yes is not equal to 1 so you always get redirected to /mains ? |
Welcome Guest, Not a member yet? Register Sign In |