Created index.php and style.php. I connected the style.php file to index.php. All imported variables work except for one, more precisely in one place, between title tags.
Previously, the main thing everything worked as created, and now it does not, what is the reason? Before that, I still set the variable for the header, but then I deleted it, and how I started to create a new variable, it was not displayed.
index.php
<? include("style.php"); //подлкючаем файл style.php $text="Программирование php"; $title="$index_tit"; ?> <!DOCTYPE html> <html> <head> <title><? print $title; ?></title> <!--css подключается как в html--> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <?php echo "<$h1 id='cent'>$logo</$h1> <$p>$text</$p> <$p>$menu</$p>"; //class, id подключаются в теге переменной как в html //в class, id используются апострифы ('') print(date('d F, Y')); //вывод даты на экран ?> </body> </html>
style.php
<?php //переменные для заголовков $index_tit="site"; //переменые для тегов $h1="h1"; $h2="h2"; $h3="h3"; $p="p"; $br="br"; $b="b"; $u="u"; $i="i"; $menu="<a href='tip_dannih.php'>типы данных</a>"; //ссылки главного меню $tip_dannih="<a href='tip_dannih1.php'>строковые значения 1</a> <a href='tip_dannih2.php'>массив</a>"; //название сайта $logo="PHP.RU"; ?> <!DOCTYPE html> <html> <head> <title><? print $title; ?></title> </head> </html>