Source Code :-
dynamic.php
<head>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){ $("b").click(function()
{
document.getElementById("include").innerHTML = "<?php echo include('Second.php');
?> "; });
$(document).on("click", "a.remove" , function()
{ $(this).parent().remove(); }); });
</script>
</head>
<body>
<b><input type='submit' value='Add second page'></b>
<div id='include'></div>
</body>
Second.php
<?php
echo 'This is second page';
?>