El código si funciona. El problema está en el echo.
Pon las comillas de fuera como dobles y las de dentro escapalas con \.
Código PHP:
Ver original<?php
<?php
include("conexion.php");
' . $_SESSION['usuario'] . ' #No entiendo que quieres hacer con esto
user_login();
<?php
echo '<meta http-equiv="Refresh" content="5;url=perfil.php"> ';
echo "<html>
<head>
<style type=\"text/css\">/*Container*/
.progress-bar {
border: 1px solid #56577A;
width: 200px;
margin: 5px;
padding: 1px;
background: #fff;
float: left;
-moz-border-radius:5px 5px 5px 5px;
-ms-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
}
.bar {
height: 15px;
font-size: 11px;
text-indent:-9000px;
-moz-border-radius:5px 5px 5px 5px;
-ms-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
}
</style>
<script type=\"text/javascript\">
window.onload = function() {initialize()}
function initialize() {
divId = \"sample\";
thedivId = document.getElementById(divId);
var percentage = thedivId.innerHTML;
thedivId.style.backgroundColor=\"#000\";
brim(divId,0,parseInt(percentage.substr(0, percentage.length-1)));
}
function brim(Id,start,percentage) {
if (document.getElementById) {
o = document.getElementById(Id);
if (start <= percentage) {
setWidth(o, start);
start += 1;
//Show progression percentage near the progress bar
document.getElementById(\"percentage\").innerHTML = (start -1) + \"%\";
window.setTimeout(\"brim('\"+Id+\"',\"+start+\",\"+percentage+\")\", 50);
}
}
}
function setWidth(o, start) {
o.style.width = start+\"%\";
}
</script>
</head>
<body>
<div class=\"progress-bar\" >
<div id =\"sample\" class=\"bar\">100%</div>
</div>
<div id =\"percentage\"></div>
</body>
</head>";
?>