If/else that contains HTML blocks, which contain additional PHP functions
A few suggestions.


Instead of writing styles in same file use an external style sheet
Also you can restructure it like:

 &lt;!doctype html&gt;
 &lt;html&gt;
 &lt;head&gt;
 &lt;title&gt;test&lt;/title&gt;
 &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
 &lt;style&gt;
 #various-styles {
 }
 &lt;/style&gt;
 &lt;/head&gt;
 &lt;body&gt;
 &lt;div&gt;
 &lt;?php
     if ($_SERVER['REQUEST_METHOD'] !== 'POST')
     {
 ?&gt;
 &lt;p&gt;You didn't come here through a Post.&lt;/p&gt;
&lt;?php
     }
     else
     {
         if(isset($_POST['a']))
         {
            $status = "HTML-blocks that contain PHP such as ";
            switch ($_POST['a'])
            {
                case "1":
                  $status .= "word1";
                break;
                case "2":
                  $status .= "word2";
                break;
                default:
                  $status .= "other";
            }
        }

        if(isset($_POST['b']))
        {
            $status .= "and ";
            switch ($_POST['b'])
            {
                case "1":
                  $status .= "word3";
                break;
                case "2":
                  $status .= "word4";
                break;
                default:
                  $status .= "other";
            }
        }
        echo $status;
 ?&gt;
 &lt;!-- other html code else block here --&gt;
 &lt;?php
    }
 ?&gt;

 &lt;/div&gt;
 &lt;/body&gt;
 &lt;/html&gt;