Welcome Guest, Not a member yet? Register   Sign In
Is there a way of detecting POST data in URL requests before routing them?
#9

[eluser]cahva[/eluser]
BTW, $_POST is a superglogal and is always defined so using isset($_POST) wont work. Better to check if its an ajax request. If you use CI2, you can use what kirkaracha told you or simply put this:
Code:
define('IS_AJAX', isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
..to application/config/constants.php

With that constant its easy to know if its an ajax request or not.


Messages In This Thread
Is there a way of detecting POST data in URL requests before routing them? - by El Forum - 01-26-2011, 06:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB