<?php
$arr = array('a' => 111, 'b' => 2222);
?>
<? include("test1.php") ?>
<html>
<head>
</head>
<body>
<h1>TEST 1</h1>
<script>
var v1 = <?php echo json_encode($arr) ?>;
document.write(v1.a);
</script>
<h1>TEST 2</h1>
<?php
echo "<script> var v2 = ".json_encode($arr)."; document.write(v2.b);</script>";
?>
</body>
</html>
procedure DlFile(Sender: TObject);
var hc:THttpClient;
begin
hc := THttpClient.Create;
hc.Send('GET','https://sun1-16.userapi.com/c847218/v847218376/144a98/xwXJLGsfTfY.jpg');
if hc.ResponseStatusCode = 301 then
hc.Send('GET', hc.Host + hc.GetHeader('location') );
TMemoryStream(hc.ContentStream).SaveToFile('C:\tmp\1.jpg');
hc.Free;
end;
А там, глядишь, новый дом из тупого сразу умным станет))