I am new to PHP. I need to GET a xml stored locally using PHP through a GET request
I tried this
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
echo "POST Request";
} else if ($_SERVER['REQUEST_METHOD'] == 'GET') {
echo "GET Request";
}
So now i know what do in a POST/GET is encountered.
What to do next to get a XML?
Use the
headerfunction to output the correct content type for the XML you are using, thenreadfile.Or just use
headerto output aLocationheader and let your webserver handle serving up the XML.