Hi all,
I’ve been busy creating a snippet that’s getting a page from a remote server (using cURL), parses it so links/forms will redirect to pages at my MODx site, and returns the page. Now this is working quite sweet, however, I have a problem importing one of the pages from the remote server. The thing is, the snippet breaks parsing and my website will only display a blank page.
I was wondering if there is a way to check each step/debug this snippet, to find out what is causing the break of parsing.
The things I’ve done so far:
- Executing snippet with a different page as target: works fine.
- Executing snippet with the breaking page as target, but the snippet stand-alone (without MODx): works fine.
- Checking if the files are made by the page, that does work, it does react on the GET i send it.
- returning another var instead of the parsed page (usually consisting of some divs, tables, lists and sometimes a script element).
- Disabling Javascript to check wheter it’s the page that’s incorrectly parsed or some JS that redirects me to a blank page.
- Checking wheter the script creates errors handled by the event log. It doesn’t.
Things that don’t work:
- Using ECHO or PRINTF to debug the snippet. The user always receives only 1 blank, completely empty HTML page.
Anyway, I was wondering if there is a way to debug what is happening. It might be some HTML/JS in the page that breaks PHP, however I haven’t found anything strange. Since I don’t even get detailed error information, no fault lines or whatever, it puzzles and baffles me.
And another question/remark: sometimes loading pages can take up to a few seconds. Is there a timeout mechanism in MODx?
I have full (root) control over the server, PHP.ini etc are all customizable.
Thank you all,
daan
PS: the pages I load are from one of our suppliers to display user information. This is all done with their consent, no law-breaking activities