• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

RESOLVED Redeclare Eval PHP

Odair Jr

New member
Messages
4
Likes
0
Points
1
#1
Hi, I'm with problem un Snippets and I don't know how resolve. How redeclare montaTexto in shortcode-php.php?

"Um erro do tipo E_COMPILE_ERROR foi causado na linha 89 do arquivo wp-content/plugins/insert-php/includes/shortcodes/shortcode-php.php(52) : eval()'d code. Mensagem de erro: Cannot redeclare montaTexto() (previously declared in public_html/wp-content/plugins/insert-php/includes/shortcodes/shortcode-php.php(52) : eval()'d code:90)"

Tks
 

Odair Jr

New member
Messages
4
Likes
0
Points
1
#3
BUG - If you see this error in the logs: "E_COMPILE_ERROR ... eval()'d code"

This means that you have already declared (montaTexto) such a function already exists in WordPress or in one of the plugins or in one of your snippets.
Thanks for your support. I can't understand where exist this error in funcion. I saw my code and file shortcode-php.php and I can´t found this duplicade function. This error started when I back backup for one error in other thing, so before this all worked very well. But now I don't know how resolve this. Any idea how I can resolve this?
 

Temyk

Developer & Support
Staff member
Messages
744
Likes
32
Points
28
#4
If you made a snippet backup, this snippet may also be running. You need to search in one of your snippets, but not in the plugin code.
 

Odair Jr

New member
Messages
4
Likes
0
Points
1
#5
If you made a snippet backup, this snippet may also be running. You need to search in one of your snippets, but not in the plugin code.
Yes, I seached, my snippets has only one funtion with montatexto, find bellow the code where mention the MontaTexto, don't have any other local.

PHP:
if (!empty($_SESSION["faturamento"])) {
    montaTexto();
}

$textoEmail = "Nome: $p_nome\n Telefone: $p_telefone\n LMG: $lmg \n Faturamento: De R$$de até R$$ate ";

function montaTexto(){
    $texto1 = "<p class='cot txt-1'><strong>".$_SESSION["cliente"]."</strong><br/>Sua cotação ficou avaliada em: </p>";
    $texto2 = "<p class='cot txt-2'>R$".$_SESSION["valorSeguro"]."</p>";
    $texto2 = "<p class='cot txt-2' id='tooltip'><span style='border-bottom: 1px dotted;'>R$".$_SESSION["valorSeguro"]."</span> *
                <span class='tooltiptext'>* Franquia de 10% dos prejuízos com mínimo de R$ 10.000,00, por sinistro</span>
               </p>";
    $texto3 = "<p class='cot txt-3'> <strong>Faturamento Anual</strong><br> "
            . $_SESSION["faturamento"] . "</br>"
            . "<strong>Limite Máximo de Garantia (LMG)</strong><br> R$" . $_SESSION["lmg"]
            . "</p>";
    echo $texto1.$texto2.$texto3;
}
 
Last edited by a moderator:

Temyk

Developer & Support
Staff member
Messages
744
Likes
32
Points
28
#6
In this code, the function is declared once. But it is also declared in a different place.
Just change the name of the montaTexto() function in your snippet.
 

Odair Jr

New member
Messages
4
Likes
0
Points
1
#7
In this code, the function is declared once. But it is also declared in a different place.
Just change the name of the montaTexto() function in your snippet.
Don't resolve, I backed backup in server befere this error, but same yet the error persist. The code don't have nothing diferent. I don't know more what I do.
 

Temyk

Developer & Support
Staff member
Messages
744
Likes
32
Points
28
#8
You can grant me access to the admin panel of your site in private messages on the forum. Then I was able to look