Такая проблема: написал две страницы как плагин в виде :
В папке components/com_straisa1 создать файлы straisa1.xml и straisa1.php. В первом прописываю код
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.0" method="upgrade">
<name>straisa1</name>
<!-- The following elements are optional and free of formatting constraints -->
<creationDate>January 2018</creationDate>
<author>John Doe</author>
<authorEmail>john.doe@example.org</authorEmail>
<authorUrl>http://www.example.org</authorUrl>
<copyright>Copyright Info</copyright>
<license>License Info</license>
<!-- The version string is recorded in the components table -->
<version>0.0.1</version>
<!-- The description is optional and defaults to the name -->
<description>Description of the Hello World component ...</description>
<update> <!-- Runs on update; New since J2.5 -->
<schemas>
<schemapath type="mysql">sql/updates/mysql</schemapath>
</schemas>
</update>
<!-- Site Main File Copy Section -->
<!-- Note the folder attribute: This attribute describes the folder
to copy FROM in the package to install therefore files copied
in this section are copied from /site/ in the package -->
<files folder="site">
<filename>index.html</filename>
<filename>straisa1.php</filename>
</files>
<administration>
<!-- Administration Menu Section -->
<menu link='index.php?option=com_helloworld'>straisa1</menu>
<!-- Administration Main File Copy Section -->
<!-- Note the folder attribute: This attribute describes the folder
to copy FROM in the package to install therefore files copied
in this section are copied from /admin/ in the package -->
<files folder="admin">
<!-- Admin Main File Copy Section -->
<filename>index.html</filename>
<filename>straisa1.php</filename>
<!-- SQL files section -->
<folder>sql</folder>
</files>
</administration>
</extension>
В Joomle создаю в меню кнопку со ссылкой на внешний url
https://domkomexpr/index.php?option=com_straisa1Вторая страница создается также, только везде straisa2.
В straisa1.php прописываю
<form action="" method="GET">
<input type="text" name="username">
<input type="submit">
</form>
<?php
//Если форма была отправлена и имя не пустое:
if (!empty($_REQUEST['username'])) {
//Пишем имя в куки:
setcookie('username', $_REQUEST['username'], time()+3600, '/');
}
?>
В straisa2.php
<?php
//Если есть данные в куки об имени пользователя:
if (!empty($_COOKIE['username'])) {
echo $_COOKIE['username']; //выведем имя на экран
}
?>
Только ничего не выводится. Если код со straisa1.php прописать в index.php шаблона сайта, то все работает нормально. В чём может быть проблема.