Hello all, please, PLEASE :injured:
Note: this is all on separate files, but I’ve put them together so that I can debug easier.
ISSUE: I cannot get the success message to display:
Here’s the “thing”:
If the mail is send, put something on this array:
if($mailer->Send())
{
$resultado['sucesso'] = 'Contacto enviado. Obrigado.';
}
else
On the HTML part of this same file:
If the $resultado is set, show the success message, else, display the form:
<?php if (isset($resultado['sucesso']) || isset($resultado['insucesso'])) { ?>
<?php echo (isset($resultado['sucesso'])) ? '<div>'.$resultado['sucesso'].'</div>':''; ?>
<?php } else { ?>
//the form is here
I then start doing var_dumps from top to bottom of this file:
var_dump($resultado['sucesso']);
Here (before the first include_once of this excerpt):
<div id="coluna-esquerda">
<?php var_dump($resultado['sucesso']); ?>
<?php include_once('Inc/ListaNoticiasInc.php'); ?>
<?php include_once('Inc/PainelLinkTornarAssociado.php'); ?>
</div>
I get the string returned. If I keep on going, one line down with the var_dump, like so:
<div id="coluna-esquerda">
<?php include_once('Inc/ListaNoticiasInc.php'); ?>
<?php var_dump($resultado['sucesso']); ?>
<?php include_once('Inc/PainelLinkTornarAssociado.php'); ?>
</div>
I get null.
After the includes, I loose the value of $resultado[‘sucesso’]. Why is this?
Any clue about what’s going on here please?? :injured::injured::injured:
It should be something really stupid because I got this working before. :sick:
Thank you in advance,
Márcio