V
V
Vlad Bonem2015-10-21 16:15:48
PHP
Vlad Bonem, 2015-10-21 16:15:48

How to display data in html using php?

Unable to display data on html page from php.
This code is stored in PHP

<?php
{
print '

  <li><a href="index.html">Главная</a></li>
<li><a href="company/index.html">О компании</a></li>
<li><a href="partnery/index.html">Партнеры</a></li>
<li><a href="arenda-spetstehniki/index.html">Аренда спецтехники</a></li>
<li><a href="prajs-list/index.html">Прайс-лист</a></li>
<li><a href="kontakty/index.html">Контактная информация</a></li>  ' ;
}
?>

And now I want to output to the right place in the html template with this command:
<div id="menu">
    <ul>
    <?php
include ('php/menu.php');
?>   
    </ul>
    </div>

But nothing happens. This code is not displayed which is in PHP (menu.php). All indifferent please help.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
I
Ivanq, 2015-10-21
@vladios13

You forgot the quote! Even toasts and toasters see it!

N
ndbn, 2015-10-21
@ndbn

HTML template must be with php extension

V
Vladislav Startsev, 2015-10-21
@esvlad

Because quotes need to be closed!
at the end of the print you need to put not ; a ';

S
Slava Kryvel, 2015-10-21
@kryvel

Look at the server logs, there will be an error due to which the code is not executed.
And to make sure that the error is in php/menu.php, you can also simply follow the link /php/menu.php and if there is a white page, then the error is in the php code.
If your text is displayed, it means that you are connecting your file with the menu incorrectly, or there is an error in the php code somewhere earlier, even before including this file.

O
Optimus, 2015-10-21
Pyan @marrk2

For example echo:
But that's not the only way

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question