A
A
Anton2015-11-01 12:58:25
PHP
Anton, 2015-11-01 12:58:25

Compiled index.php for a one-pager, what's wrong?

Hello. I'm just learning php, wrote a simple index.php for a single page block. What is done wrong?

Header("Content-Type: text/html;charset=UTF-8");

    define("_ROOT", __DIR__ . '/');
    define("_BASEURL", "http://" . $_SERVER["HTTP_HOST"]);
    define("_BLOCKS", __DIR__ . '/blocks/');

  include_once _BLOCKS . 'header.php';
  include_once _BLOCKS . 'nav.php';
  include_once _BLOCKS . 'slider.php';
  include_once _BLOCKS . 'about.php';
  include_once _BLOCKS . 'portfolio.php';
  include_once _BLOCKS . 'contacts.php';
  include_once _BLOCKS . 'footer.php';

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
Anar4you, 2015-11-01
@Anar4you

define("_ROOT", __DIR__ . '/');
    define("_BASEURL", "http://" . $_SERVER["HTTP_HOST"]);
    define("_BLOCKS", __DIR__ . '/blocks/');

why do all this?

M
MK, 2015-11-01
@Maxsior

The title was sent ahead of time, if you still have php code running in your includes

M
Mikhail Lyalin, 2015-11-01
@mr_jok

Do you even need PHP for a one-pager?

D
Dmitry Evgrafovich, 2015-11-01
@Tantacula

<?phpforgot the opening tag at the beginning

A
Alexey, 2015-11-02
@AlekseyChuyan

Look towards autoload habrahabr.ru/post/138920

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question