Title: WordPress form with custom PHP code (no plugin)
Last modified: August 22, 2016

---

# WordPress form with custom PHP code (no plugin)

 *  [DimitriDVV](https://wordpress.org/support/users/dimitridvv/)
 * (@dimitridvv)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/wordpress-form-with-custom-php-code-no-plugin/)
 * I downloaded a plugin that enables custom PHP code. I can now paste PHP code 
   in any page. But, this line does not work <form action=”contact”> for a custom
   contact form:
 * **Page not found. Please try to go back to the homepage.**
 * Contact is the name of the page. Entering the full path also does not work.
    
   This does also not work: _<form name=”contactform” method=”post” action=”<?php
   echo $\_SERVER[‘PHP\_SELF’]; ?>”>
 * How can I solve this please?
    Please understand I am NOT looking for a plugin.

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

 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [11 years, 9 months ago](https://wordpress.org/support/topic/wordpress-form-with-custom-php-code-no-plugin/#post-5174581)
 * > I downloaded a plugin that enables custom PHP code.
 * Which plugin was that? Knowing that may help understand _how_ to make it work
   on your site.
 * I know that you are not looking for a plugin but please be aware that PHP code
   is PHP code. It doesn’t add or subtract when you use a plugin (as I’ve said, 
   code is code) but using a plugin does make it easier for you to maintain and 
   manage your WordPress installation.
 *  Thread Starter [DimitriDVV](https://wordpress.org/support/users/dimitridvv/)
 * (@dimitridvv)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/wordpress-form-with-custom-php-code-no-plugin/#post-5174590)
 * [https://wordpress.org/plugins/allow-php-in-posts-and-pages/](https://wordpress.org/plugins/allow-php-in-posts-and-pages/)
 * Which plugin do you recommend? I need a text box where I can add some intro text
   and I need a form with name – email – telephone and anti spam.
 *  [RossMitchell](https://wordpress.org/support/users/rossmitchell/)
 * (@rossmitchell)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/wordpress-form-with-custom-php-code-no-plugin/#post-5174655)
 * If you want to use php and not use a plugin, then you could put your code into
   a page template. Then it will be in your theme (hopefully a child theme).

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

The topic ‘WordPress form with custom PHP code (no plugin)’ is closed to new replies.

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 3 replies
 * 3 participants
 * Last reply from: [RossMitchell](https://wordpress.org/support/users/rossmitchell/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/wordpress-form-with-custom-php-code-no-plugin/#post-5174655)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
