1
On the site I took over from another developer, done in PHP and Javascript, there is a search for events created (all registered in Mysql database table). In each event searched, I created a button to be able to delete it:
<input name="excluir" type="button" class="textDescricaoSobre font13" value="Excluir" onclick="excluiEvento(<?php echo $evento['id'];?>)" style="cursor: pointer; width: 55px; margin-left: 10px;" />
And the event exclusion function, in javascript:
function excluiEvento(val){
var valor = val;
location.href = "http://meusite/excluir/"+valor;
}
Since this link goes to delete function, set in my Controller file:
public function excluir(){
class_exists('Servico') || include_once CLASS_PATH . 'Servico.class.php';
echo "<script>alert('Evento ".$_POST['valor']." foi pego')</script>";
self::consultaeventos();
}
Everything works fine, but the value of the javascript variable value is not displayed in the alert. How can I see this value? Session Usage? Use $_GET instead of $_POST?