problem php opening tags

0

Hi folks, I'm working with php (version 5.6.22-4) on the osgeolive platform (version 10.5) and I'm having problems with php opening tags. if I put

    <?php

I get this on the web if I put

    <?

I get this

I attach the PHP code of the file listClients.php

    <?
      // capa control 
      require_once('modelo.php'); 
      require_once('accesoadatos.php'); 
      $objClienteAD = new clienteAD;
      $listaCliente = $objClienteAD->listar();
    ?>
    <table>
            <tr>
                <td class="auto-style1" style="width: 70px">Id</td>
                <td class="auto-style1" style="width: 222px">Nombre</td>
                <td class="auto-style1" style="width: 88px">Estado</td>
            </tr>
    <?
       foreach($listaCliente as $cliente)
            { 
    ?>

            <tr>
                <td style="width: 70px"><?php echo $cliente['ruc'];?></td>
                <td style="width: 222px"><?php echo $cliente['nombre']; 
    ?>          </td>
                <td style="width: 88px"><?php echo $cliente['estado'];
    ?>         </td>
          </tr>             
    <?
            }
    ?>
    </table>

Does anyone know where the problem is? PS: this example code worked previously but then this started to happen

    
asked by fer 11.10.2017 в 15:16
source

1 answer

1

You have to put in your php.ini

short_open_tag = On

  

Tells PHP if the abbreviated labels should be allowed   opening PHP

<? ?>

  

If you want to use PHP together with XML,   this option can be disabled to be used online. Yes   no, it can be printed with PHP, for example:

<?php echo '<?xml version="1.0"?>'; ?>
  

Also, if it is disabled, it should be used   always the abbreviated form of the PHP opening tag

<?php ?>
    
answered by 11.10.2017 / 15:38
source