Hi guys,
I´m using MODX REVO and have the problem to get the following code to work.
Heres my code-snippet:
<?php
$handle = fopen("http://www.domain.com/some-page.asp", "rb");
$contents = '';
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}
fclose($handle);
echo $contents;
?>
This code works without any problem in a normal PHP-file on my webserver (outside of MODX!), but it doesn´t if I insert this code into a MODX-snippet (neither saved as a static file nor in database).
The output?
The modx-page, where i included the snippet via [[mysnippet] or [[!mysnippet]], is served as a totally blank page - the source-code is completly empty. No errors listed under "REPORT > ERROR LOG".
I cleared the cache serveral times as well.
When I try some other way, like "file_get_contents", there´s the same problem. In a single php-file (outside of MODX) it works, implemented into MODX is doesn´t.
The whole problem is some kind of weird and too complicated to explain in all its details. The workaround I have to realise is to get the content of a parsed (ASP)file and just to output the content in my modx-page.
Any ideas?
Is there maybe some system variable in modx which blocks the fopen-command?