title: how to put php variable to convert to mp3
body: <p>I am trying to convert mp4 to mp3 using ffmpeg.</p>
  
  <p><strong>I want to upload the mp4 file from user then convert the same to mp3</strong></p>
  
  <pre><code>if(isset($_POST['uploadimage'])){
    $file_name = $_FILES['image']['name'];
    $file_size = $_FILES['image']['size'];
    $file_tmp = $_FILES['image']['tmp_name'];
    $file_type = $_FILES['image']['type'];
    $file_ext=strtolower(@end(explode('.',$_FILES['image']['name'])));
  
    $extensions= array("mp4");
  
    if(in_array($file_ext,$extensions)=== false){
       $errors[]="extension not allowed, please choose a JPEG file.";
     }
    else if($file_size &gt; 2097100) {
       $errors[]="larger size";
       }
   else if(empty($errors)==true) {
       move_uploaded_file($file_tmp,"input/".$file_name);
       echo"moved";
       $a= "input/".$file_name;
       echo $input_file;
       $b= "output/audio2.mp3";
       exec("ffmpeg.exe");
        exec("ffmpeg -i $a -vn $b", $output, $return);
        if (!$return) {
        echo " Success";
        } 
       else {
       echo " &lt;br&gt;failed";
       }
       }
       } 
       &lt;form method="post" enctype="multipart/form-data"&gt;
       &lt;input type='file' name="image" /&gt;
       &lt;input type="submit" name="uploadimage" value="Submit"&gt;
       &lt;/form&gt;
  </code></pre>
  
  <p><strong>session not created
  Above is an error I'm getting.</strong></p>