Title: Run php action when button pressed
Last modified: June 3, 2018

---

# Run php action when button pressed

 *  [BarnDoor](https://wordpress.org/support/users/alex94/)
 * (@alex94)
 * [8 years ago](https://wordpress.org/support/topic/run-php-action-when-button-pressed/)
 * Hello,
 * I’d like to run a simple php script when a button is pressed. Is this possible?
   I’ve achieved a similar thing with contact forms by hooking into the action that
   is called when the form is submitted, and specifying the form id. Is there a 
   similar action I can hook to in MaxButtons?
 * Thanks!
    Alex

Viewing 1 replies (of 1 total)

 *  Plugin Author [Bas Schuiling](https://wordpress.org/support/users/basszje/)
 * (@basszje)
 * [8 years ago](https://wordpress.org/support/topic/run-php-action-when-button-pressed/#post-10359058)
 * Hi Alex,
 * This is not really possible. The simple reason is that the buttons are being 
   displayed on the client, while PHP runs on the server. Contact forms sends data
   to the server, so you can hook into that, but MaxButtons doesn’t.
 * I don’t know what you want to run, but sometimes with combining other plugins
   a solution is possible. Or dig in and see how you can create your own small javascript/
   ajax script handler.

Viewing 1 replies (of 1 total)

The topic ‘Run php action when button pressed’ is closed to new replies.

 * ![](https://ps.w.org/maxbuttons/assets/icon-128x128.png?rev=1378636)
 * [MaxButtons - Create buttons](https://wordpress.org/plugins/maxbuttons/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/maxbuttons/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/maxbuttons/)
 * [Active Topics](https://wordpress.org/support/plugin/maxbuttons/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/maxbuttons/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/maxbuttons/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Bas Schuiling](https://wordpress.org/support/users/basszje/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/run-php-action-when-button-pressed/#post-10359058)
 * Status: not resolved