this is the complete script :
<?php
$file = $_POST['file'];
$exploded = explode('.', basename($file));
$log_type = $exploded[0];
chdir('/tmp');
exec('cp /var/imzali_kayitlar/' . $file . ' ./');
exec('tar zxvf ' . basename($file));
// Doğrulama komutu
exec('openssl ts -verify -data /tmp/' . $log_type . '.log -in /tmp/' . $log_type . '.log.der -token_in -CAfile /CA/cacert.pem -untrusted /CA/tsacert.pem', $result);
if ($result[0] == 'Verification: OK') {
$imza = file_get_contents($log_type . '.log.imza');
echo '<p class="success">Doğrulama başarılı!</p>';
echo '<div>' . nl2br($imza) . '</div>';
}
else {
echo '<p class="error">Doğrulama başarısız!</p>';
}
exec('rm ' . $log_type . '.l*');
exit;
I have the .log and .leases files inside a folder, and to run the script I have a webpage that I go there where there is a button beside every file then I click on the button then it runs the above script in the backgroud and shows the result if the verification is ok or not.
here is some pics of the files and the webpage:
when I change .log to .leases then the above will be opposite.
.* or .l* doesnt work.