I am trying to get my progress bar to update with the actual PHP code when completed.
var url2 = '';
function progressBarSim(al) {
var bar = document.getElementById('progressBar');
var status = document.getElementById('status');
status.innerHTML = al+"%";
bar.value = al;
al++;
var elem = document.getElementById("progressBar");
elem.style.width = al + '%';
var sim = setTimeout("progressBarSim("+al+")",77);
if(al == 100){
status.innerHTML = "100%";
bar.value = 100;
clearTimeout(sim);
var finalMessage = document.getElementById('finalMessage');
finalMessage.innerHTML = "<?php include('hi.php'); ?>";
}
}
var amountLoaded = 0;
progressBarSim(amountLoaded);
The above code works when I don't include PHP code inside my hi.php
file but if I include any form of actual PHP code inside the file it will just make my entire progress bar not work anymore. How can I make my progress bar load hi.php when it's reached 100%?