log
class. Example usageWell, in my case there are no ACP configurations. Form is displayed in overall header.
class ext extends base
Code: Select all
<?php
$path = dirname(__FILE__) . '/files';
$pLauma = '';
$myFile = $path . '/pLauma.txt';
if (isset($_POST['pLauma']) && !empty($_POST['pLauma'])) {
$pLauma = $_POST['pLauma'].PHP_EOL;
}
if ($pLauma) {
$fh = fopen($myFile, 'a') or die("can't open file"); //Make sure you have permission
fwrite($fh, $pLauma);
fclose($fh);
$lines = file($path . '/pLauma.txt');
$array = array_sum($lines);
file_put_contents($path . '/rLauma.txt', $array);
}
header("location:../../../index.php");
Thank you for the examples. Maybe you know why in them they are using
case:
? Can I suggest that you review your PHP programming knowledge.
I havn't and I cannot see many, if any, reasons why an extension would add a log entry in the ext.php file.
Haha, my PHP knowledge is rather non existent First time dealing with it actually.