Try using this:
<html>
<body>
<?
echo $SERVER['DOCUMENT_ROOT'];
// AND
echo '"value=".substr( "http://".$SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'], 0, -8)';
?>
</body>
</html>
If that doesnt work try this:
<html>
<body>
<?
echo $SERVER['DOCUMENT_ROOT'];
// AND
echo \"value=".substr( "http://".$SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'], 0, -8);
?>
</body>
</html>