I need to store the content of story
inside mysql table.
This content will later be normally loaded on another page using php
.
piano.php
is a third, separate file and I don't want it on the current page, but only on the target page.
So I'm trying to insert php code inside story
content but it is automatically commented (see in console);
How to do this?
$('button').on('click', function() {
var a = "<div class='part partpiano'><?php include('piano.php');?></div>";
$(a).insertBefore($('.title'));
console.log($('.story').html());
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class='story'>
<div class='title'>lorem</div>
</div><br>
<button>CLICK</button>