Php – How to return a HTML file as the response to a POST request

PHP

I send a POST request to a PHP page, and depending on what the contents are I want it to return one of two independent HTML pages I have written.

Best Answer

if ($_POST['param'] == 'page1' )
    readfile('page1.html');
else
    readfile('other.html');