Seiya Posted December 20, 2011 Share Posted December 20, 2011 I'm developing an addon where AJAX is used to pull knowledgebase categories from the database. addons\my_addon.php addons\get_kb_categories.php However, the get_kb_categories script which is called via AJAX doesn't have the DB object so any queries to the database fail. If I add the code from the get_kb_categories.php script to the main script, then it works, but WHMCS returns the full HTML page and not just the value so this approach doesn't work either. Does anyone know of a solution which doesn't involve me manually having to connect to the database? 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted December 20, 2011 Share Posted December 20, 2011 What code are you adding? You just need to add this to the file: require_once 'dbconnect.php'; require_once 'includes/functions.php'; Adjust paths accordingly. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.