I am working on a php code as shown below where I am converting mp4 files into mp3 using system command ffmpeg (in the case stateme
The best way is to use XMLHttpRequest with better example here AJAX - Server Response
Create a javascript function like this :
Add somewhere something to handle the response of the server as you want; example:
Modify the button to call the javascript function onclick="go('', this); return false;":
Take the time to learn how works Ajax call, it's really important to communicate with the server if you don't use form
You can use JQuery but it's better without ;)
Edit
Using form, you can do this:
Edit :
Replace $key by the House Number basename($file, ".mp4")
and the page.php or your_encoder.php as you want for an Ajax call :
// EXAMPLE FOR AJAX CALL
"
. $result;
} else {
echo "The file $filePath does not exist";
}
?>
If you use form, you have to:
check if $_POST['key'] exists
do the encoding if key exists
send your new html table.
// EXAMPLE FOR FORM CALL
Edit :
I know this adapted from your preview question but this code is "uncorrect", it works, no problem, but it can be optimized like this :
from...
... to