4
I am placing some instructions inside the same PHP file that are executed according to the variable value send
received, at least that’s what I thought. This code has two of these instructions, one that receives send == 'buUserBloqueia'
and another who receives send == 'cCadSend'
but once the first receives the command, executes the instruction and does not finish executing also the next ones that has another value of send
.
Code
// Função serve para bloquear o usuário do sistema
if((isset($_POST['send']) == "buUserBloqueia") && (isset($_POST['id']) != "")){
// Esta função bloqueia um usuário
exit();
}
// Função serve para cadastrar o usuário no sistema
if ((isset($_POST['send']) == "cCadSend")){
// Esta função cria um usuário
exit();
}
Why is it that by submitting Ajax with a value of send
after checking the value of the send
in PHP, the script keeps running all the instructions below it?
Attention problem in reused code in which within the instruction was repeating an Insert. Served to learn that isset returns true or false. Hugs
– Marcos Vinicius