Login to WordPress from another website

I have a Simple PHP Website at www.example.com and I have a wordpress blog at www.example.com/blog/ and both of them have user login pages. I would like the user to logged into the wordpress blog as well when the user logs in using www.example.com login.

Please help

Related posts

Leave a Reply

2 comments

  1. The proper way of doing it is

    • Create a wordpress plugin
    • Use the plugin to listen for the wordpress engine initiation
    • On initiation check for the user session in the browser or in your external application
    • If a user session is found (assuming your usernames and emails are unique for both systems, so that a single registration is allowed with it) check for a wordpress user with matching username or email
    • If a wpuser is found, set the current user as that
    • If no user is found create a new wordpress user and set him as the current user

    There are neat API’s available for doing this in wordpress. We have used it to integrate wordpress with many external websites, CMS and Social networking sites like Elgg.