Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Sravanthi P on
Hi,
I have created a PHP file to perform some functionality on submitting a form which is designed in Drupal. Where should I paste that file in order to get it displayed in the same theme?
Thanks in advance.
Comments
Module, not theme
If your code performs an action when a form is submitted, then it should be implemented as a module, not in a theme. And it should be implemented using the Drupal form API. Your custom code can add itself as a callback to be invoked when the form is submitted.