I'm currently creating a filter panel for a bespoke webform submissions table using Drupal JQuery AJAX. I have a button which posts data to my php include and returns the document without a hitch, I have an SQL query which when placed directly into my content in PHP mode returns fine.

Now here's my problem, when I insert the query in to my include file without any changes it returns only up to the point where my SQL starts.

Does anyone have any experience this or am I missing something fundamental?

Thanks

Comments

billshankley’s picture

Solution,

Your PHP file is outside of Drupal, therefore it doesn't have access to any of Drupal's functions. Basically, you can't just add PHP files to a Drupal framework and call them directly. The processing code must exist within another module.

What I think you want to do here is create a Menu item in your module, then have the menu callback refer to whatever code you want it to implement.

Thanks Steve Wright from Washington!

for further info the rest of the thread is here