site php returns [closed]

1

My page is returning > minor signal when add the following code that is commented:

<form name="form_import" id="form_import" method="post" action="<?php echo $_endereco ?>" enctype="multipart/form-data">
  <table class="formulario">
    <tbody>
      <tr class="cabecalho">
        <th colspan="2">
          Agraves - importar
        </th>
      </tr>
      <tr>
        <th>
          <label>Tipos de Agreve</label>
        </th>
      </tr>
      <tr>  <th></th>
        <td>
          <a href="upload_foto/agrave_pdf.php">
            <ul>
              <li>Agrave 4 salarios</li>
              <li>agrave 10 salarios</li>
            </ul>
          </a>
        </td>
      </tr>
      <tr>
        <th>
          <label>Arquivo </label>
        </th>
        <td>
          <input type="file" name="arquivo" id="nome_arquivo"/>
        </td>
      </tr>
      <tr class="rodape">
        <td colspan="2">
          <input type="hidden" name="advogado" id="acao" value="<?php echo $_SERVER['PHP_SELF']."?login=$_SESSION['_codigo_usuario']"; ?>">
          <button type="submit" src="mgm/importa.png" alt="Importar" class="elemento_a_direita"/>Importar
        </td>
      </tr>
    </tbody>
  </table>
</form>
    
asked by anonymous 18.09.2017 / 20:21

2 answers

1

Your code is wrong on the line:

<input type="hidden" name="advogado" id="acao" value="<?php echo $_SERVER['PHP_SELF']."?login=$_SESSION['_codigo_usuario']"; ?>">
  

See (not) working on Ideone .

If the intention is to concatenate the session value in string , the simplest is to get it out of it:

<input type="hidden" name="advogado" id="acao" value="<?php echo $_SERVER['PHP_SELF']."?login=".$_SESSION['_codigo_usuario']; ?>">
  

See working at Ideone .

Or use the keys to correctly format the string :

<input type="hidden" name="advogado" id="acao" value="<?php echo "{$_SERVER['PHP_SELF']}?login={$_SESSION['_codigo_usuario']}"; ?>">
  

See working at Ideone .

Related question:

What is the purpose of {} in the code below? and what is the definition?

    
18.09.2017 / 21:26
-1

try removing the two slashes after concatenation:

   <form name="form_import" id="form_import" method="post" action="<?php echo $_SERVER['PHP_SELF']."?login=$_SESSION['_codigo_usuario']"; ?>" enctype="multipart/form-data">
    
18.09.2017 / 20:41