Title: [Plugin: PHP Snippets] error getting data from a form
Last modified: August 20, 2016

---

# [Plugin: PHP Snippets] error getting data from a form

 *  [GabyS](https://wordpress.org/support/users/gabys/)
 * (@gabys)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/plugin-php-snippets-error-getting-data-from-a-form/)
 * I’m new to wordpress. I have some php pages that work fine outside of wp but 
   when trying to move them into the wp site the form data is not getting passed.
   This part works;
 * `$courseid = $_REQUEST['courseid'];`
 * As it is passed in the URL.
 * I then pull up a form (contained in the snippet) based on the courseid. It’s 
   when that is filled out and submitted I get strange results. I’m using a REQUEST
   to get the information. Should I be doing something differently?
 * [http://wordpress.org/extend/plugins/php-snippets/](http://wordpress.org/extend/plugins/php-snippets/)

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

 *  [fireproofsocks](https://wordpress.org/support/users/fireproofsocks/)
 * (@fireproofsocks)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/plugin-php-snippets-error-getting-data-from-a-form/#post-2753711)
 * The PHP Snippets bit is designed to be as passive as possible, so any strange
   results are likely a result of your code and not the plugin’s.
 * E.g. always test that the variable has been set, e.g.
 *     ```
       $courseid = '';
       if (isset($_REQUEST['courseid'])) {
          $courseid = $_REQUEST['courseid'];
       }
       ```
   
 * I’d have to see more of your code to comment on what else it might be doing. 
   You can paste code in the pastebin.
 *  Thread Starter [GabyS](https://wordpress.org/support/users/gabys/)
 * (@gabys)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/plugin-php-snippets-error-getting-data-from-a-form/#post-2753722)
 * Ok, I tried that and it is getting the course id. so… here’s the code.`
 * _[311 lines of code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome#Posting_Code).
   The maximum number of lines of code that you can post in these forums is **ten
   lines**. Please use the [pastebin](http://wordpress.pastebin.com/)]_
 * Yes I’m new to this and anything would help.
 *  Thread Starter [GabyS](https://wordpress.org/support/users/gabys/)
 * (@gabys)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/plugin-php-snippets-error-getting-data-from-a-form/#post-2753732)
 * Sorry there was so much code.
 *  [fireproofsocks](https://wordpress.org/support/users/fireproofsocks/)
 * (@fireproofsocks)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/plugin-php-snippets-error-getting-data-from-a-form/#post-2753753)
 * You gotta use the pastebin, otherwise your code gets removed from the post.
 *  Thread Starter [GabyS](https://wordpress.org/support/users/gabys/)
 * (@gabys)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-php-snippets-error-getting-data-from-a-form/#post-2754117)
 * I got pulled away from this and just got back. I also fixed my issue. Just thought
   I ought to let you know.
 * Thanks for the quick response.

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

The topic ‘[Plugin: PHP Snippets] error getting data from a form’ is closed to new
replies.

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

 * 5 replies
 * 2 participants
 * Last reply from: [GabyS](https://wordpress.org/support/users/gabys/)
 * Last activity: [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-php-snippets-error-getting-data-from-a-form/#post-2754117)
 * Status: not resolved