Нужно при клике на кнопки изменять наполнение файла, клик по первой - перезапись в abc.php текста из abc1.php ("import"), клик по второй - "export".
Текст в файлах abc.php "main" abc1.php "import" abc2.php "export"
Код обработки
<?php
function importfunc(){
$file1 = '/home/user/web-site.com/www/administrator/components/com_jshopping/importexport/compleximportexport/abc.php';
$file2 = '/home/user/web-site.com/www/administrator/components/com_jshopping/importexport/compleximportexport/abc1.php';
$file1cont2 = file_get_contents($file2, true, $context);
file_put_contents ($file1, $file1cont2);
}
function exportfunc(){
$file11 = '/home/user/web-site.com/www/administrator/components/com_jshopping/importexport/compleximportexport/abc.php';
$file22 = '/home/user/web-site.com/www/administrator/components/com_jshopping/importexport/compleximportexport/abc2.php';
$file1cont22 = file_get_contents($file22, true, $context);
file_put_contents ($file11, $file1cont22);
}
?>
Скрипт
<script>
function importconf(){
alert("<?php importfunc(); ?>");
}
function exportconf(){
alert("<?php exportfunc(); ?>");
}
</script>
Кнопки на странице
<button onclick="importconf()">Change import config</button>
<button onclick="exportconf()">Change export config</button>