Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

254
Views
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();
?>

'''

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

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>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!