Title: Using insert php code snippet when processing a form on a website
Last modified: May 28, 2022

---

# Using insert php code snippet when processing a form on a website

 *  [andrayleo](https://wordpress.org/support/users/andrayleo/)
 * (@andrayleo)
 * [3 years, 12 months ago](https://wordpress.org/support/topic/using-insert-php-code-snippet-when-processing-a-form-on-a-website/)
 * I have the following html code to process a form:
 * `<form id="finform" method="post" action=Cadiz.php>`
    …
 *     ```
       <input class="submit_btn" type="submit" value="Calculate">
       </form>
       ```
   
 * As can be seen from the forms code, when you click on the Submit button ( “Calculate”)
   runs the file Cadiz.php.
 * With Insert php code snippet, I created a snippet with the name of Cadiz and 
   put in this snippet the code from Cadiz.php file.
 * Could you tell me please how I should correct the `action=Cadiz.php` code so 
   that the form would use the snippet Cadiz?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Sruthy@xyzscripts](https://wordpress.org/support/users/sruthy123/)
 * (@sruthy123)
 * [3 years, 12 months ago](https://wordpress.org/support/topic/using-insert-php-code-snippet-when-processing-a-form-on-a-website/#post-15690602)
 * The snippets are worked by shortcodes and this is not possible to use a shortcode
   inside form since shortcodes are not allowed in html attributes.
 *  Thread Starter [andrayleo](https://wordpress.org/support/users/andrayleo/)
 * (@andrayleo)
 * [3 years, 12 months ago](https://wordpress.org/support/topic/using-insert-php-code-snippet-when-processing-a-form-on-a-website/#post-15692920)
 * Do I understand correctly that snippets (including using shortcodes) cannot be
   used to process forms using php code?
 *  [Sruthy@xyzscripts](https://wordpress.org/support/users/sruthyxyz/)
 * (@sruthyxyz)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/using-insert-php-code-snippet-when-processing-a-form-on-a-website/#post-15711264)
 * You can’t set a snippet as form action.You can create the form and its action
   in the same snippet.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Using insert php code snippet when processing a form on a website’ is
closed to new replies.

 * ![](https://ps.w.org/insert-php-code-snippet/assets/icon-128x128.png?rev=1800967)
 * [Insert PHP Code Snippet](https://wordpress.org/plugins/insert-php-code-snippet/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-php-code-snippet/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-php-code-snippet/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-php-code-snippet/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-php-code-snippet/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-php-code-snippet/reviews/)

## Tags

 * [form](https://wordpress.org/support/topic-tag/form/)

 * 3 replies
 * 3 participants
 * Last reply from: [Sruthy@xyzscripts](https://wordpress.org/support/users/sruthyxyz/)
 * Last activity: [3 years, 11 months ago](https://wordpress.org/support/topic/using-insert-php-code-snippet-when-processing-a-form-on-a-website/#post-15711264)
 * Status: not resolved