Where to include external PHP functions accessible globally

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
rafee
User
Posts: 34

Where to include external PHP functions accessible globally

Post by rafee »

Where to exactly place external PHP functions file to be accessible globally?

I am creating bunch of functions in Sever Event Global Code but some Im not comfortable editing the code without the use 3rd party editing tools.
So I prefer to edit it directly externally and leave as it is without copying back to Global code event.


mobhar
User
Posts: 11747

Post by mobhar »

You may simply use "Page_Head" server event under "Server Events" -> "Global" -> "All Pages". Please read "Server Events and Client Scripts" topic for more info and example.


arbei
User
Posts: 9410

Post by arbei »

You may also use include or include_once to include your script into Global Code.


rafee
User
Posts: 34

Post by rafee »

arbei wrote:
You may also use include or include_once to include your script into Global Code.

Got it done. Perfectly working but the "Execute" function is no longer recognized in my external file. B4, this was working. I do the coding under Global Code.

What else should I include in my External php file? Thanks


mobhar
User
Posts: 11747

Post by mobhar »

If you're using v2019, this should help: hkvforums.com/viewtopic.php?f=18&t=43518


rafee
User
Posts: 34

Post by rafee »

Thank u, perfectly working!


Post Reply