Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact

Login with PHP

Simple Membership Plugin › Forums › Simple Membership Plugin › Login with PHP

  • This topic has 3 replies, 2 voices, and was last updated 11 years ago by sifenks.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • November 12, 2015 at 10:00 pm #3939
    sifenks
    Participant

    I’m trying to create a user check page. I use it on my own product(VB.NET) but expiry days always the same.
    result:
    Login successful.
    Days: noexpire

    Why it is writing “no expire”?
    How can I do that?

    PHP Code:

    <?php 
    	include("wp-config.php");
    	include_once('wp-content/plugins/simple-membership/classes/class.swpm-utils.php');
    	
    	$username = $_GET['username'];
    	$password = $_GET['password'];
    	
    	$user = get_user_by( 'login', $username );
    	if ( $user && wp_check_password( $password, $user->data->user_pass, $user->ID) ){
    	    echo "Login successful.<br>Days:";
    		$permission = SwpmPermission::get_instance($username->membership_level);
    		echo SwpmUtils::calculate_subscription_period_days($permission->get('subscription_period'), $permission->get('subscription_duration_type'));
    	}else{
    		echo "ERR";
    	}
    ?>
    November 12, 2015 at 10:39 pm #3942
    mbrsolution
    Moderator

    Hi you might like to check the following documentation. It will provide some ideas for your code.

    Regards

    November 13, 2015 at 1:37 pm #3961
    sifenks
    Participant

    Thank you. I did check this code, but what I want is not here. I want to read user expire date using username.

    November 13, 2015 at 1:57 pm #3962
    sifenks
    Participant

    In fact, if you write me would be enough login function. How do I log in?

    this code wordpress login:

    	$username = $_GET['username'];
    	$password = $_GET['password'];
    	
    	$user = get_user_by( 'login', $username );
    	if ( $user && wp_check_password( $password, $user->data->user_pass, $user->ID) ){
    	    echo "Login successful.";
    	}

    but this function can not be logged to Simple Membership.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Log In

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy