Sometimes, you want to change the constants values on the fly in the configuration file of websites that generated by PHPMaker. For example, you want to change the values of EW_REMOVE_XSS constant which has default value as TRUE in the configuration file become FALSE for the certain pages.
To do this, you can change the value by setting the last parameter in the define() part of the constants become FALSE, afterwards, change the value in the second parameter to the desired value.
Let's have a look at the following example. This is one of the constants we can find in the configuration (ewcfg*.php) file in order to enable anti-xss feature in the websites that generated by PHPMaker:
// Default value of anti-xss constant is TRUE define("EW_REMOVE_XSS", TRUE, TRUE);
To disable anti-xss, then put this in one of your related Server Events:
// Disable anti-xss constant define("EW_REMOVE_XSS", FALSE, FALSE); // the first FALSE will disable the anti-xss, the second FALSE will override the original value of constant in configuration file
To enable it back, then put this in your another Server Events. As you can see, the last parameter is alaways FALSE. The second parameter is TRUE in order to enable it back.
// Enable anti-xss constant define("EW_REMOVE_XSS", TRUE, FALSE); // the first TRUE will enable the anti-xss, the second FALSE will override the original value of constant in configuration file
This trick is very useful for you if you want to change the values of the constants that defined in the configuration file.
Leave a Reply
You must be logged in to post a comment.