Thanks for your quick reponse ZAP. Its all helpful.
I added the code to the page I’m restricting.
If I leave:
define("IN_PARSER_MODE", "true");
in then it comes back true.
If I take it out so it looks like:
if ( !defined(IN_PARSER_MODE) ) echo 'IN_PARSER_MODE not defined';
else echo IN_PARSER_MODE;
exit();
I get not defined.
This happens in both cases, with or without modx.
I’m getting more lost as time goes on
Edit: I’ve done some more testing and I can see that this should work but I fear there is something very odd with my setup. I’ve done some further testing and if I add the following snippet:
<?php
define ("X", "TRUE");
echo X;
echo IN_PARSER_MODE;
?>
and call that via a chunk:
[[codecheck]]
<div>
<iframe name="iframe1" src="/index.php" align="top" height="600" width="100%" hspace="0" vspace="0" border="0"></iframe>
</div>
<br /><br />Then my echo’s come back with the following:<br />
TRUEtrue
IN_PARSER_MODE not defined
<br /><br />The first TRUE relates to X, the second true relates to IN_PARSER_MODE, the third callback: IN_PARSER_MODE not defined relates to the code inside /index.php<br /><br />I’m going to work on using snippets to create a constant and see if I can include /index.php call from inside the snippet that way.<br /><br />Thanks to you both for your help. It has come in exceptionally handy. :)<br /><br />BBloke