Jump to content

PHP Question


jhecht
 Share

Recommended Posts

Well I'm building a forum system that is made in AJAX, but is also backwards compatible for browsers that have JS disabled. Now, in my previous version of PHP, i would set the header X-Requested-with, and PHP would take that header and make it a part of the server variable, allowing me to access it through $_SERVER['X_REQUESTED_WITH']. Only problem as of now is that it doesn't seem to do that in the newer version. I've read around the PHP documentation, and found no function that gets the current headers being sent. If i perhaps missed it, then please just show me the page and I can take it from there, but if there isn't a function, as i assume there isn't, can someone with perhaps a better knowledge of PHP/Headers help me out a bit here? I'm stumped and haven't been able to figure this out for almost 2 days.Thanks for any help in advanced.

Link to comment
Share on other sites

You can check these pages to see what it is you wanthttp://us2.php.net/manual/en/function.headers-sent.php - Checks to see if headers have been senthttp://us2.php.net/manual/en/function.headers-list.php - Returns list of response headers in an indexed arrayMust have PHP installed as an Apache Modulehttp://us2.php.net/manual/en/function.apac...est-headers.php - Returns requested headers in an associative arrayhttp://us2.php.net/manual/en/function.apac...nse-headers.php - Returns response headers in an associative array

Link to comment
Share on other sites

If the application needs to be portable from outside of Apache (or work as CGI instead of just an Apache module), you can also usehttp_get_request_headers(). THAT however requires the PECL HTTP extension instead. There seems to be no built in function to do what you're asking.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...