CodeIgniter Forums
Strange redirect() problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Strange redirect() problem (/thread-11676.html)



Strange redirect() problem - El Forum - 09-18-2008

[eluser]Jay Turley[/eluser]
Okay, I'm stumped.

In my controller, I have two form-processing functions. The only difference between them is that one uses the file upload class, and the other does not. They take the same URI segments as input, etc.

At the end of the non-file function, I call redirect() like so:

Code:
redirect('store/view/'.$category_id.'#i-'.$item_id);

and it works perfectly, returning me to not only the proper category page, but to the appropriate named anchor on the page.

At the end of the file-uploading function, I call redirect() like so:

Code:
redirect('store/view/'.$category_id.'#i-'.$item_id);

(notice any difference? I can't, because I cut-and-pasted the fricking code in my controller)

Inevitably, it returns me to "store/view/12" (assuming that $category_id = 12). It just chops off the #i-117 (again, assuming $item_id = 117).

Echoing the redirect() argument shows that it is correct.

Oh, and here's the real kicker: it only happens in IE7. I was testing in FF2/3 and it was working just fine.

Why would this happen? Any ideas? I'm leaning toward some wierd interaction with the file upload class, but on the other hand, I might just be FAILing.

Help?


Strange redirect() problem - El Forum - 09-19-2008

[eluser]sophistry[/eluser]
take out the dash in the anchor and see what happens.


Strange redirect() problem - El Forum - 09-19-2008

[eluser]Jay Turley[/eluser]
[quote author="sophistry" date="1221859790"]take out the dash in the anchor and see what happens.[/quote]

Thanks, Sophistry, I'll try it tonight.