editorpa 0 Denunciar post Postado Julho 27, 2011 ola meu codigo deu esse erro,por favor me ajudem Parse error: syntax error, unexpected $end in C:\wamp\www\ptr\funciones.php(22) : eval()'d code on line 47 function mostrarTemplate($tema, $variables) { //var_dump($variables); extract($variables); eval("?>".$tema."<?php"); } Compartilhar este post Link para o post Compartilhar em outros sites
Leozitho 81 Denunciar post Postado Julho 28, 2011 O erro é porque você está fechando a marcação PHP dentro da função eval. Qual é o objetivo da sua função? Compartilhar este post Link para o post Compartilhar em outros sites
Kakashi_Hatake 267 Denunciar post Postado Julho 28, 2011 Qual é o objetivo da sua função? Acrescentando: Use a função eval APENAS se você conhecer exatamente o que será a entrada. Compartilhar este post Link para o post Compartilhar em outros sites
editorpa 0 Denunciar post Postado Julho 28, 2011 esse e meu codigo dee uma olhada switch($tipr) { case("premium"): require('config.php'); $sql = "SELECT * "; $sql.= "FROM tb_ads WHERE tipo='ads' and category='$indice' ORDER BY fechainicia DESC"; $rs = mysql_query($sql, $con); mysql_close($con); if(mysql_num_rows($rs)>0) { // Leemos el contenido de la plantilla de temas $template = implode("", file("titulosp.php")); while($row = mysql_fetch_assoc($rs)) { $row["last"]=uc($_COOKIE["usNick"]); $row["total"]=$row["outside"] + $row["members"]; $bold=$row["bold"]; if ($bold=="1") { $row["bold"]="<b>"; $row["boldc"]="</b>"; } $highlight=$row["highlight"]; if ($highlight=="1") { $row["highlight"]="#cccccc"; $row["highlight"]="#cccccc"; } $ji=$row["members"]; $jo=$row["plan"]; if ($ji >= $jo) { $row["description"]=""; $row["members"]=""; $row["outside"]=""; $row["total"]=""; $row["id"]=""; } mostrarTemplate($template, $row); } } break; default: require('config.php'); $sql = "SELECT * "; $sql.= "FROM tb_ads WHERE tipo='ads' and category='$indice' ORDER BY fechainicia DESC"; $rs = mysql_query($sql, $con); mysql_close($con); if(mysql_num_rows($rs)>0) { // Leemos el contenido de la plantilla de temas $template = implode("", file("titulos.php")); while($row = mysql_fetch_assoc($rs)) { $row["last"]=uc($_COOKIE["usNick"]); $row["total"]=$row["outside"] + $row["members"]; $bold=$row["bold"]; if ($bold=="1") { $row["bold"]="<b>"; $row["boldc"]="</b>"; } $highlight=$row["highlight"]; if ($highlight=="1") { $row["highlight"]="#cccccc"; $row["highlight"]="#cccccc"; } $ji=$row["members"]; $jo=$row["plan"]; if ($ji >= $jo) { $row["description"]=""; $row["members"]=""; $row["outside"]=""; $row["total"]=""; $row["id"]=""; } mostrarTemplate($template, $row); } } } }else{ require('config.php'); //require('funciones.php'); $sqlr = "SELECT * "; $sqlr.= "FROM tb_ads WHERE tipo='ads' and category='$indice' ORDER BY fechainicia DESC"; $rsr = mysql_query($sqlr, $con); mysql_close($con); if(mysql_num_rows($rsr)>0) { // Leemos el contenido de la plantilla de temas $templater = implode("", file("titulos1.php")); while($rowr = mysql_fetch_assoc($rsr)) { $rowr["total"]=$rowr["outside"] + $rowr["members"]; $bold=$rowr["bold"]; if ($bold=="1") { $rowr["bold"]="<b>"; $rowr["boldc"]="</b>"; } $highlight=$rowr["highlight"]; if ($highlight=="1") { $rowr["highlight"]="#cccccc"; $rowr["highlight"]="#cccccc"; } $ji=$rowr["members"]; $jo=$rowr["plan"]; if ($ji >= $jo) { $rowr["description"]=""; $rowr["members"]=""; $rowr["outside"]=""; $rowr["total"]=""; $rowr["id"]=""; } mostrarTemplate($templater, $rowr); } } resolvido pessoal foi um erro bobo esqueci de fecha com }. Compartilhar este post Link para o post Compartilhar em outros sites