Call Lite.php functions via ajax

Discussion in 'Troubleshooting' started by sam_potasznik, Apr 20, 2017.

  1. sam_potasznik

    sam_potasznik New Member

    Oct 25, 2016

    I'm building my website using aMember for the backend and a static site generator for the content and front-end. I'm not knowledgeable about php.

    Is it possible to call specific functions in Lite.php from ajax on the front-end? I've seen a few discussions on Stack Overflow of how to call php functions from javascript in a general way, but calling a specific function from a php script seems to involve modifying the server-side code, and I do not want to mess with Lite.php.

    All I really want to do is determine if the user is logged in already or not and then display text and links accordingly.

    Is the easiest solution to write my own php script which just includes Lite.php and then returns Am_Lite::getInstance()->isLoggedIn() and then call that from ajax? If so, what would such a script look like?

    Thanks so much,

Share This Page