title: Submitting form (PHP): after submitting my php code seems not to execute
body: <p>I have an issue with my php form. I have an application that manages users in a LDAP server so I want to give the possibility to users to change their password anytime they want to using a form.</p>
  
  <p>In the form we need tree informations (old password, newwpassword and the uid of the concerned ldap entry). We extract the uid from the displayName which can be a complete name: we consider that the first word is always the uid (just to notice it but that's not much important here).</p>
  
  <p>So i have the form with this following code:</p>
  
  <pre><code>&lt;?php
    // echo '&lt;pre&gt;';  
  // print_r($_POST);
    // echo '&lt;/pre&gt;';
  
    function str_to_noaccent($str) { 
      $url = $str; 
      $url = preg_replace('#Ç#', 'C', $url); 
      $url = preg_replace('#ç#', 'c', $url); 
      $url = preg_replace('#è|é|ê|ë#', 'e', $url);
      $url = preg_replace('#È|É|Ê|Ë#', 'E', $url);
      $url = preg_replace('#à|á|â|ã|ä|å#', 'a', $url);
      $url = preg_replace('#@|À|Á|Â|Ã|Ä|Å#', 'A', $url);
      $url = preg_replace('#ì|í|î|ï#', 'i', $url);
      $url = preg_replace('#Ì|Í|Î|Ï#', 'I', $url);
      $url = preg_replace('#ð|ò|ó|ô|õ|ö#', 'o', $url);
      $url = preg_replace('#Ò|Ó|Ô|Õ|Ö#', 'O', $url);
      $url = preg_replace('#ù|ú|û|ü#', 'u', $url);
      $url = preg_replace('#Ù|Ú|Û|Ü#', 'U', $url);
      $url = preg_replace('#ý|ÿ#', 'y', $url);
      $url = preg_replace('#Ý#', 'Y', $url);
      return ($url);
    }
  
    if(isset($_POST['soumission']))
    {
       if(isset($_POST['oldpassword']) &amp;&amp; isset($_POST['newpassword']) &amp;&amp; isset($_POST['displayName']))
       {
       $oldpasswd = $_POST['oldpassword'];
           $newpassd = $_POST['newpassword'];
           $arr = explode('',$_POST['displayName']);
       $user_uid = str_to_noaccent(strtolower($arr[0]));
  
           $cmd = exec('script.sh '.$oldpasswd.' '.$newpassd.' '.$user_uid);
       if($cmd)
       {
         echo '&lt;script language="text/javascript"&gt;';
         echo 'alert("Mot de passe changé avec succès!")';
         echo '&lt;/script&gt;';
       }
       else
       {
         echo '&lt;script language="text/javascript"&gt;';
         echo 'alert("Impossible de changer de mot de passe!")';
         echo '&lt;/script&gt;';
       }
      }
     }
  ?&gt;
  
  &lt;form class="section" method="post" action="&lt;?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?&gt;"&gt;
      &lt;h2&gt;Mot de passe&lt;/h2&gt;
      &lt;input type="password" name="oldpassword" placeholder="Ancien mot de passe" autocomplete="off" autocapitalize="off" autocorrect="off" /&gt;
      &lt;input type="password" id="pass2" data-typetoggle="#personal-show" name="newpassword" placeholder="Nouveau mot de passe" autocomplete="off" autocapitalize="off" autocorrect="off" /&gt;
      &lt;input type="checkbox" id="personal-show" name="show" /&gt;&lt;label for="personal-show"&gt;&lt;/label&gt;
      &lt;input type="hidden" id="displayName" name="displayName"
      value="&lt;?php p($_['displayName']) ?&gt;"
      autocomplete="on" autocapitalize="off" autocorrect="off" readonly /&gt;
      &lt;input type="submit" name="soumission" value="Changer le mot de passe"/&gt;
     &lt;div class="strengthify-wrapper"&gt;&lt;/div&gt;
  &lt;/form&gt;
  &lt;?php
  ?&gt;
  </code></pre>
  
  <p>The content of the script.sh is as follows:</p>
  
  <pre><code>#! /bin/bash
  /usr/bin/ldappasswd -h @IP_ldap_server -p 389 -x -D 'cn=admin,dc=xxxxx,dc=xxxxx,dc=xx' -w xxxxxx -a $1 -s $2 uid=$3,ou=xxxx,dc=xxxx,dc=xxxx,dc=xx
  </code></pre>
  
  <p>Everything like script.sh, str_to_noaccent, etc. have been tested individually and works perfectly. Even the print_r($_POST); shows that form values are well get.</p>
  
  <p>But it seems that the php code is not executed (from the if(isset($_POST['soumission'])) to the end of the first php block). It's been days but I still can figure out why. Can sombebody here help to find what's wrong?</p>
  
  <p>Thank you all very much in advance.</p>