title: Html to run a system command
body: <p>I am trying to run this command to create a folder inside my raspberry pi but it isn't working. 
  I am not good with PHP or HTML. I googled and i am unable to solve, so posting it here. 
  If it is repeated and the solution exists. please do provide me the link. 
  TIA
  Code:</p>
  
  <pre><code>    &lt;html&gt;
  &lt;head&gt;
  &lt;?php 
  if (isset($_POST['TestA']))
  {
  exec('sudo mkdir /www/test');
  }
  if (isset($_POST['TestB']))
  {
  shell_exec('sudo mkdir /www/test1');
  }
  
  ?&gt;
  
    &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form method="post"&gt;
    &lt;table
   style="width: 75%; text-align: left; margin-left: auto; margin-right: auto;"
   border="0" cellpadding="2" cellspacing="2"&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td style="text-align: center;"&gt;Test case 1&lt;/td&gt;
          &lt;td style="text-align: center;"&gt;Test case 2&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style="text-align: center;"&gt;&lt;button name="TestA"&gt;test 2&lt;/button&gt;&lt;/td&gt;
      &lt;td style="text-align: center;"&gt;&lt;button name="TestB"&gt;test 2&lt;/button&gt;&lt;/td&gt;
    &lt;/tr&gt;
  
  &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>