Title: Missing sreg.class
Last modified: August 21, 2016

---

# Missing sreg.class

 *  [pazifikwelle](https://wordpress.org/support/users/pazifikwelle/)
 * (@pazifikwelle)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/missing-sregclass/)
 * ….-form/lib/sreg.class.php): failed to open stream: No such file or directory
   in ….plugins/simplr-registration-form/simplr_form_functions.php on line 439
 * [22-Sep-2013 12:02:29 UTC] PHP Fatal error: require_once(): Failed opening required‘…..
   form/lib/sreg.class.php’ (include_path=’.:/Applications/MAMP/bin/php/php5.4.4/
   lib/php’) in ….plugins/simplr-registration-form/simplr_form_functions.php on 
   line 439
 * ==> File is simply not included in your production package.
    ==> Please submit
   updated version of your plugin!
 * Thank you.
 * [http://wordpress.org/plugins/simplr-registration-form/](http://wordpress.org/plugins/simplr-registration-form/)

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

 *  [kvkooten](https://wordpress.org/support/users/kvkooten/)
 * (@kvkooten)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/missing-sregclass/#post-4151675)
 * Yes, I’m having the same problem. The result is that the page on which I had 
   implemented the form via shortcodes now doesn’t show any of the manually entered
   text. It just says that “sreg.class.php” is missing. It also messes up certain
   parts of my CSS…
 *  [Lucas Balzer](https://wordpress.org/support/users/lbalzer/)
 * (@lbalzer)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/missing-sregclass/#post-4151727)
 * Plus one for this issue. Just downloaded the current version archive, and sreg.
   class.php is missing from the /lib directory. Can you please add back in, or 
   let us know name of the file that includes the sreg class?
 * Thanks. Really looking forward to this plugin. It’s exactly what I need!
 * Lucas
 *  [Nagaraj](https://wordpress.org/support/users/nagrajsuligavi/)
 * (@nagrajsuligavi)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/missing-sregclass/#post-4151780)
 * For Solution, replace the sreg_basic function on line 438, with the following
   function. Enjoy !!
 *     ```
       function sreg_basic($atts) {
       //Check if the user is logged in, if so he doesn't need the registration page
       if ( is_user_logged_in() AND !current_user_can('administrator') ) {
       global $user_ID;
       $first_visit = get_user_meta($user_ID, 'first_visit',true);
       if(empty($first_visit)) {
       $message = !empty($atts['message'])?$atts['message']:"Thank you for registering.";
       update_user_meta($user_ID,'first_visit',date('Y-m-d'));
       echo '<div id="message" class="success"><p>'.$message.'</p></div>';
       } else {
       echo "You are already registered for this site!!!";
       }
       } else {
       //Then check to see whether a form has been submitted, if so, I deal with it.
       global $sreg;
       if(isset($sreg->success)) {
       return $sreg->output;
       } else {
       if(is_array($sreg->errors)) {
       $out = '';
       foreach($sreg->errors as $mes) {
       $out .= '<div class="simplr-message error">'.$mes .'</div>';
       }
       } elseif(is_string($sreg->errors)) {
       $out = '<div class="simplr-message error">'.$message .'</div>';
       }
       return $out.simplr_build_form($_POST,$atts);
       }
   
       } //Close LOGIN Conditional
   
       } //END FUNCTION
       ```
   
 * _[Moderator Note: Please post code & markup between backticks or use the code
   button. Your posted code may now have been permanently damaged by the forum’s
   parser.]_
 *  [nafsruh](https://wordpress.org/support/users/nafsruh/)
 * (@nafsruh)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/missing-sregclass/#post-4151783)
 * [@nagaraj](https://wordpress.org/support/users/nagaraj/)
 * Thank you for your solution!!! I couldn’t get in touch with the developer. I’m
   happy someone else found this out!

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

The topic ‘Missing sreg.class’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/simplr-registration-form_be8c38.svg)
 * [Simplr Registration Form Plus+](https://wordpress.org/plugins/simplr-registration-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simplr-registration-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simplr-registration-form/)
 * [Active Topics](https://wordpress.org/support/plugin/simplr-registration-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simplr-registration-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simplr-registration-form/reviews/)

 * 4 replies
 * 5 participants
 * Last reply from: [nafsruh](https://wordpress.org/support/users/nafsruh/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/missing-sregclass/#post-4151783)
 * Status: not resolved