Send by POST

1

Good morning, I have a problem, because I was using a website sending the data by GET and of course now I am aware of this and I want to modify it to POST so that the data is not displayed. The GET data sent them via URL as follows:

 <td>
 <a href="?action=editar&id=<?php echo urlencode($r->acronimo); ?>"><img src="icon_editthis.png" width="30px" height="30px"/></a>
 </td>
 <td>
 <a href="?action=eliminar&acronimo=<?php echo urlencode($r->acronimo); ?>"><img src="delete.png" width="30px" height="30px"/></a>
 </td>

Now the idea is how to modify that to send it POST post.

My form is this which should allow you to modify or enter data, which for example chose to edit or delete records from the code you entered before.

<form action="?action=<?php echo isset($obj_categoria) ? 'actualizar' : 'registrar'; ?>" method="POST" class="pure-form pure-form-stacked" style="margin-bottom:30px;">
            <input type="hidden" name="id" value="<?php echo isset($obj_categoria) ? $obj_categoria->__POST('acronimo') : ''; ?>" />

 <table style="width:500px;">
 <tr>
 <th style="text-align:left;">Acronimo</th>
 <td><input type="text" name="acronimo"  value="<?php echo isset($obj_categoria) ? $obj_categoria->__POST('acronimo') : ''; ?>" style="width:100%;" required /></td>
 </tr>
 <tr>
 <th style="text-align:left;">Categoria</th>
 <td><input type="text" name="categoria"  value="<?php echo isset($obj_categoria) ? $obj_categoria->__POST('categoria') : ''; ?>" style="width:100%;" required/></td>
 <td colspan="2">
 <button type="submit" class="pure-button pure-button-primary">Guardar</button>
 </td>
 </tr>
 </table>
 </form>

So in summary, can I use URL to go through POST or how should I do it?

If it were not possible, as it could be then, thank you in advance

    
asked by Alberto Cepero de Andrés 28.04.2017 в 08:44
source

1 answer

1

To send the information by post you must send the data using a form.

For example:

 <td>
  <form method="post">
    <input type="hidden" name="action" value="editar" />
    <input type="hidden" name="id" value="<? php echo urlencode($r->acronimo); ?>" />
    <input type="image" src="icon_editthis.png" name="submit" />
  </form>
 </td>
 <td>
  <form method="post">
    <input type="hidden" name="action" value="eliminar" />
    <input type="hidden" name="id" value="<? php echo urlencode($r->acronimo); ?>" />
    <input type="image" src="delete.png" name="submit" />
  </form>
 </td>
    
answered by 28.04.2017 / 08:59
source