Title: Validation not working, not finding plugin library code
Last modified: August 22, 2016

---

# Validation not working, not finding plugin library code

 *  Resolved [alex-r](https://wordpress.org/support/users/alex-r/)
 * (@alex-r)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/validation-not-working-not-finding-plugin-library-code/)
 * My server side validation xxx.php cannot find “wpmsrc_check” after I embedded
   the validation php code.
    This always fails: function_exists( ‘wpmsrc_check’ )
 * I created a custom form and my form statement is coded like this:
    action=”/wp-
   content/custom-php/xxx.php”
 * I don’t understand why my xxx.php cannot find wpmsrc_check?
    It appears my xxx.
   php cannot access any plugin libraries, but how can I make it do so?
 * Thanks for any help.
    –Alex (newbie)
 * [https://wordpress.org/plugins/simple-recaptcha/](https://wordpress.org/plugins/simple-recaptcha/)

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

 *  [cdillon27](https://wordpress.org/support/users/cdillon27/)
 * (@cdillon27)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/validation-not-working-not-finding-plugin-library-code/#post-5868881)
 * Hi Alex,
 * xxx.php cannot find wpmsrc_check because loading xxx.php directly bypasses WordPress.
 * This is one reason you may see
 *     ```
       /** If this file is called directly, abort. */
       if ( ! defined( 'ABSPATH' ) ) {
       	die;
       }
       ```
   
 * in a core, plugin or theme file.
 * To prove it, add that snippet to the top of xxx.php and see what happens.
 * The technique required to handle this is called Post-Redirect-Get (PRG).
    1. Your form posts to the action file which processes the $_POST.
    2. The action file redirects to a target page, probably your form again.
    3. If necessary, the target page fetches the result of the $_POST (a new record,
       setting, etc.) and display feedback to the user (success, failure).
 * I recently ran across this on the admin side. This [StackOverflow answer](http://stackoverflow.com/a/20003981/51600)
   helped me; you will need to determine the front-end equivalent.
 * In case you’re using /custom-php as a directory for miscellaneous scripts, consider
   building a simple plugin instead of dropping files in /wp-content directly.
 * Let me know if I can help with any of this.
 * Chris
 * **Edit:** After re-reading that SO thread, it seems the WordPress handler it 
   refers to also works on the front-end. I have not tried that yet.
 *  Thread Starter [alex-r](https://wordpress.org/support/users/alex-r/)
 * (@alex-r)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/validation-not-working-not-finding-plugin-library-code/#post-5868968)
 * You are awesome! Thanks very much for your tip I have it working now. Had a hard
   time finding an answer to this problem.

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

The topic ‘Validation not working, not finding plugin library code’ is closed to
new replies.

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

## Tags

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

 * 2 replies
 * 2 participants
 * Last reply from: [alex-r](https://wordpress.org/support/users/alex-r/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/validation-not-working-not-finding-plugin-library-code/#post-5868968)
 * Status: resolved