AnsweredAssumed Answered

Using FM via PHP, wrapping my head around it

Question asked by njem on Dec 27, 2014
Latest reply on May 19, 2015 by jdw1

I built an extensive IWP public site. This year a web designer will make a new PHP face for it. They'll do PHP and I do the FM side and I need to make a mental shift of gears. I've answered some of my own questions by experiment but just because I CAN do something one way doesn't mean it's the best way. Would appreciate any input on these thoughts on PHP->FM being different from direct use of FM (even if by IWP or WebDirect).


1. Scripting mostly being in FM: I'm envisioning keeping scripting mostly in FM. That PHP will simply tell FM it wants the pledge total from last year for the bowlers on a given team (it's a fundraiser site), so the captain can see what he did last year. FM would run a script that would go to a layout that gives the bowler IDs for that team. Then take each bowler ID in turn and go to a layout that lists their pledges. Get the total for each one, add up a grand total, and say back to PHP what the result is, or an error code that that team couldn't be found or whatever. (There are better ways to structure and script this, it's just an example.) I assume having FM do all that makes more sense, and I hope so because it will make it easier for me to build changes or new features.


2. Layouts: Since FM does so much by layouts I assume I'll still need to use those. As in the example above, even when a layout is only accessed in a script and never actually seen, FM still operates by layouts. So even though no layouts will be seen at all since PHP is the user interface, I still need to use layouts a lot.


2B. Similar to remote control: To a large extent the new PHP will be a remote control driver of the layouts that were presented via IWP last year.


3. Continuous sessions: I assume that when a PHP web session opens an FM session that it's much the same as a physical user starting an FM session. I mean, if PHP opens a session and asks to get some user account info for John Smith, and, as part of the FM script that gets that data, it goes to the User Account layout, then the User Account layout continues to be "open" just as if a user had gone to it. So if the next PHP command triggers a script that, A: goes to the Middle Name field, B: highlights all, C: Copy, and then delivers that info back to PHP, it will get the middle name for John Smith because it left off on the User Account layout and specifically on the John Smith record.


4. Multiple sessions: Continuing on that question, if multiple people come to the site at the same time (obviously the idea) then each PHP session opens its own FM session. John Smith's session and Mary Doe's session don't get mixed up just like they wouldn't if they were users directly in FM.


5. Closing sessions: I suppose just like with IWP, if the user is nice enough to hit the logout button then PHP can close the FM session. Otherwise we're stuck with waiting on the timeout, and there's the usual tradeoff of not having too long of a time-out so there aren't too many open, abandoned sessions.