3
How do I display error messages in a variable, for example: Executed the code all right then has to appear the first message:
if($count==1)
{
// PRIMEIRA MENSAGEM
$change_profile_msg[] = "<div class='alert alert-success'>
<button type='button' class='close' data-dismiss='alert'>×</button>
<strong>Sucesso!</strong> Perfil atualizado.
</div>";
}
else
{
$change_profile_msg[] = "<div class='alert alert-danger'>
<button type='button' class='close' data-dismiss='alert'>×</button>
<strong>Erro ao atualizar!</strong> Não foi possível atualizar o usuario.
</div>";
}
There in the place I want to display the message:
$main_content .= ' EXIBIR MENSAGEM AQUI DENTRO APOS TUDO OCORRER BEM OU MAL NO SUBMIT DO FORMULARIO ';
It would be something like:
foreach($change_profile_msgs $change_profile_msg) {
$main_content .= ''.$change_profile_msg;
}
Only then it will display error message saying something like Undefined variable and will only show the message when running Submit, how do I hide that foreach until run the form and return something to display the message ?
You can check the type of request, if a GET user is opening the registration screen, if it is POST he is recording the information.
– rray