php server variables

php server variables


php server variables
x-requested-with missing in php $_SERVER variable when using apache?

hi, i'm having a problem. i'm requesting some content from the apache server using ajax. in php, i want to detect if the request was done through ajax and i know the way to detect this is to see if x-request-with is in the $_SERVER variable. i checked HTTP_X_REQUEST_WITH but it's missing.

i don't know but what are possible causes why this may be lost? if this will help, i'm using an alias to access my pages.

thanks!

AFAIR $_SERVER scope vars (in most CGI languages, I am NOT very proficient in PHP) hold global server info, request is NOT global, it is short lived and very specific.
I suggest you try looking in CGI scope instead...

[phpbay]php server variables, 30, "11211"[/phpbay]
[phpzon]php server variables, 5, Electronics[/phpzon]

PHP Variables

Leave a Reply