• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

156
Vistas
how to include php file in larvel ckeditor?

Hey I would like to include a php file into my larvel blog page using, ckeditor. I have 2 problems when I add in tags they are commented out and html tags are just filtered out in the database. When I just add the <?php code or script in the database directly to the body in database the code is still there but the <?php code still does not parse/execute but it will show up in the blog page.

I can execute php from my database as long as I am the using php eval() function, but the eval is not parsing in ckeditor source code. Any solution would be greatly appreciated. Im using larvel 5.7 and ckeditor 4+

Here are the images db image

inserted php in db

blog post img ckeditor output

ck source img view ckeditor source code img

For reference here are pics of php eval() without using larvel ckeditor db img

working php eval reference

output img output img

code to output/ reference for working example '''

$servername = "";
$username = "";
$password = "";
$dbname = "";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
}

$sql = "SELECT * FROM e.g.";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
  // output data of each row
  while($row = $result->fetch_assoc()) {
    
    $row1 = $row['middle_name']; //would be changed to row['body'] for larvel blog

    eval($row1);
    
  }
} else {
  echo "0 results";
}
$conn->close();
?>

'''

over 3 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

nvm I found a bypass.

you can use an html onload="";

<div id="topBar"> <a href ="#" onload="load_home()"> HOME </a> </div>
<div id ="content"> </div>
<script>


function load_home() {
document.getElementById("content").innerHTML='<object type="text/html" data="sometthing.html" ></object>';
</script>
}

You can also use an <iframe src="" in the ckeditor or add directly to the database to add php code on that file

<iframe onload="function()" src="...eg page you want to load"></iframe>
over 3 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda