" up I am creating a website with php. On localhost, everything works fine. On my hosting, everything also looks good, but on top of the...">

PHP "?>" up

I am creating a website with php. On localhost, everything works fine. On my hosting, everything also looks good, but on top of the page I see "?>". In my code, these characters are missing.

What is it?

+3
source share
4 answers

Perhaps your code uses short open tags ( <?instead <?php), and your hosting provider has disabled short open tags. This would mean, however, that your PHP code is not interpreted at all. It may also mean that your hosting provider does not support PHP at all or only for certain types of files.

Take a look at the source code of the page to see if this is so.

+4
source

, , .

  • , ?> php-
  • , <? <?php

, ?> <?php

+3

Are you sure you see ?>, not something like >>??

Otherwise, it smells of PHP-EndTag, which has never been opened ... check your code.

0
source

If you have empty lines in the source file before opening <?php-tag, then these empty lines can be output unintenionally. If your script should start at the <?phptop, remove all empty lines above it.

0
source

Source: https://habr.com/ru/post/1738510/


All Articles