I have trouble doing the following in my short PHP script:
switch ( $_SERVER["REQUEST_METHOD"] )
{
// Options:
case "OPTIONS":
{
// Send a specific reply / identify ourself.
}break;
// GET/Download file
case "GET":
{
// Code for sending stuff goes here.
}break;
[...etc...]
}
What I'm trying to do is to build a simple WebDav server in PHP. Most Dav clients send an OPTIONS request to the HTTP server, which in turn should reply with some specific headers. My problem is that the case: "OPTIONS" - section in my PHP-script NEVER gets executed. It seems like Apache doesn't reveal the OPTIONS thingy to the PHP script. Is there a solution? I need to detect OPTIONS and reply with specific headers. How?
Allman