Forums

event switcher load external php file

pirosoft 29 Jan, 2018
Hi, i try to include external php file in event switcher, but don't go, is it possible?
GreyHead 29 Jan, 2018
Hi pirosoft ,

Which version of ChronoForms are you using? There should be no problem in including a PHP file in CFv5 - and I think that it is also possible in CFv6.

Bob
vivora66 13 Feb, 2019
Hello, Im new in CF6, in CF5 the event switcher have a  code field, I dont see that code field in CF6 to inset custom PHP code for the event switcher
healyhatman 13 Feb, 2019
Answer
1 Likes
Have a PHP block BEFORE the event switcher that RETURNs the value you want. Then in the switcher, use
{var:phpblockname}

If you need the value to come from a script in an external PHP file, then just include it in the PHP block
vivora66 13 Feb, 2019
Thank you, I will try it
vivora66 13 Feb, 2019
Do I need put the <? ?> tags? because I have an error 500 when the form execute the PHP
healyhatman 13 Feb, 2019
Nit in the PHP block, but yes in your external file
This topic is locked and no more replies can be posted.