Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6539629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:52:52+00:00 2026-05-25T10:52:52+00:00

This is quite difficulty for me. Please help. I’ve a website created with cake

  • 0

This is quite difficulty for me. Please help.
I’ve a website created with cake PHP in root domain (say mysite.com) and a blog in a directory called “blog” (mysite.com/blog).
I have a register/login feature in PHP site.
So what I want here is, whenever a member login in the main site using the login form, whenever he open the blog (mysite.com/blog), he shoulb be as logged in as the same user logged in the main PHP site.
In the same way, whenever a new user sign-up with the registration form in the main PHP site, he should become an user in the wordpress blog.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:52:53+00:00Added an answer on May 25, 2026 at 10:52 am

    In your main site, you have to include WP’s functions by using wp_signon

    define('WP_USE_THEMES', false); //this disables the theme
    require('/blog/wp-blog-header.php'); //includes wordpress functions
    

    And then, you can auto-login a user in WP by using

    $credentials = array();
    $credentials['user_login'] = 'example';
    $credentials['user_password'] = 'plaintextpw';
    $credentials['remember'] = true;
    $user = wp_signon( $creds, false );
    if ( is_wp_error($user) ) {
    //login failed
    echo $user->get_error_message();
    }
    

    This should work fine, I hope this helps you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know I'm not asking this quite right, either. Please help me better form
This is quite a controversial topic, and before you say no, is it really,
Firstly this has turned out to be quite a long post so please bear
I was just reading this article :- http://css-tricks.com/perfect-full-page-background-image/ Please note this css :- #bg
Please bear with me on this, this is quite difficult to explain and I
I am intentionally leaving this quite vague at first. I'm looking for discussion and
I run into this quite often where a new page is supposedly tested and
I've seen this quite a few times while using Office Interop classes this.CustomXMLParts.Add(MyResources.Data, new
I have this quite popular problem, but have failed to find a solution that
I've edited this quite a bit and bolded my question at this point. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.