Tell me how to make such a structure correctly. There are index.php and sometext.php . On the index.php page there is a form:
<HTML> <HEAD> <TITLE>Отчет</TITLE> <meta charset="utf-8"> </HEAD> <BODY> <H3> <center><font color="#1E90FF">Отчет</font></H3> <center> <table width="1" border="0"> <form enctype="multipart/form-data" method="post"> <tr><td width="50%"><i>Планируемый адрес установки:</i></td><td align="right"><input type="text" name="install_address" maxlength="40" value="<?php if (isset($_POST['install_address'])) echo $_POST['install_address']; else echo "";?>"></td></tr> <tr><td colspan="2"><i>Примечание:</i><br><textarea cols="50" rows="3" name="free_descr" value="<?php if (isset($_POST['free_descr'])) echo $_POST['free_descr']; else echo "";?>"></textarea></td> </tr><tr><td colspan="2"><center><input type="submit" value="Генерировать"></center></td></tr> </form> </table> </center> <?php if ($_POST['free_descr']) { $install_address = $_POST['install_address']; $freedescr = $_POST['free_descr']; echo <<<EOT Полученные параметры:<br> <b>Планируемый адрес установки:</b> $install_address<br> <b>Примечание:</b> $freedescr<br> EOT; $sometext='sometext.php'; echo file_get_contents($sometext); }; ?> </BODY> </HTML> Contents of the file sometext.php :
<?php ## Place<br> Место установки $install_address<br> ## Descr<br> Примечание $freedescr<br> Отправлено<br> ?> I'm trying to ensure that the content of sometext.php displayed on index.php . The content is displayed, but displayed as is, that is, $install_address and $freedescr not changed, and $freedescr and $install_address are written.
How to make the content change?
sometext.php? This should cause an error. - aliasecho? - Alexey Shimansky<?php echo" ..... "; ?><?php echo" ..... "; ?>- splash58file_get_contentshave to write thestr_replacethose variables that are insometext.php, because everything that got thefile_get_contentsobtained with a regular line / text ....... you need ratherincludefor such purposes ..... .but not forgetting to do<?php echo $install_address ?>and<?php echo $freedescr?>and the first tag and the final one, on the contrary, remove - Alexey Shimansky