Title: Problem with using a form
Last modified: August 21, 2016

---

# Problem with using a form

 *  [iharald112](https://wordpress.org/support/users/iharald112/)
 * (@iharald112)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/problem-with-using-a-form/)
 * Hi,
 * great plugin which fulfills (nearly) all my requirements.
 * If I try to create a form (input field) I am not able to use the information 
   entered by the user on the target page (which is defined in the <form> section(“
   action=”…”) as the information entered is not available in the variable specified
   in the <input> section.
 * I learned that a predefined object can be used to exchange data between snippets(
   $PHPPC …) (and posts?) but this does not work with a form – or am I wrong?
 * I would appreciate it if there is a solution for this problem …
 * Thx,
    Harald
 * [https://wordpress.org/plugins/php-code-for-posts/](https://wordpress.org/plugins/php-code-for-posts/)

Viewing 1 replies (of 1 total)

 *  [battingboy90](https://wordpress.org/support/users/battingboy90/)
 * (@battingboy90)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/problem-with-using-a-form/#post-4735684)
 * I am having some troubles using a form with this plugin as well. My form will
   not show up. here is my code:
 * <?php
 * $action=$_REQUEST[‘action’];
 * if ($action==””) /* display the contact form */
    {
 * ?>
 * <form action=”” method=”POST” enctype=”multipart/form-data”>
    <input type=”hidden”
   name=”action” value=”submit”> Your name: <input name=”name” type=”text” value
   =”” size=”30″/> Your email: <input name=”email” type=”text” value=”” size=”30″/
   > Your message: <textarea name=”message” rows=”7″ cols=”30″></textarea> <input
   type=”submit” value=”Send email”/> </form>
 * ?>
    <?php
 * }
    else{ $name=$_REQUEST[‘name’]; $email=$_REQUEST[’email’]; $message=$_REQUEST[‘
   message’]; if (($name==””)||($email==””)||($message==””)) { echo “All fields 
   are required, please fill the form again.”; } else{ $from=”From: $name<$email
   >\r\nReturn-path: $email”; $subject=”Message sent using your contact form”; mail(“
   battingboy90@aol.com”, $subject, $message, $from); echo “Email sent!”; }
 * }
 * ?>
 * Any help is appreciated!

Viewing 1 replies (of 1 total)

The topic ‘Problem with using a form’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/php-code-for-posts_0d1022.svg)
 * [PHP Code for posts](https://wordpress.org/plugins/php-code-for-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/php-code-for-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/php-code-for-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/php-code-for-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/php-code-for-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/php-code-for-posts/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [battingboy90](https://wordpress.org/support/users/battingboy90/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/problem-with-using-a-form/#post-4735684)
 * Status: not resolved