Welcome Guest, Not a member yet? Register   Sign In
_remap ignoring IS_AJAX call?
#1

[eluser]chamilyan[/eluser]
I have a controller called redirect.php that redirects from and to views. This controller for the most part has one public _remap function that does all the redirecting with a case statement. Everything has been working great until I sent a $.POST from a view back to the controller. I want it to hit the _remap and look for the fact that the request is coming from AJAX then do it's case.

I have a
Code:
IS_AJAX
constant I'm checking against.

Code:
define('IS_AJAX', isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');

but whenever I hit the page it's always remapping to the default and sending my request to that page where it's basically returning me that pages data back when I'm echoing and alerting the data to and fro.

Any insights?
#2

[eluser]danmontgomery[/eluser]
post the _remap?
#3

[eluser]chamilyan[/eluser]
nevermind, my bad

see http://stackoverflow.com/questions/69157...-ajax-call

I was using IS_AJAX as a URL function.




Theme © iAndrew 2016 - Forum software by © MyBB