Add Moodle login form to external site

moodle-log-in-external-siteA client needed to have a Moodle login form to their external site. Well, not totally external as the Moodle was installed in a subfolder called, duh, moodle, and the main site was one step up from it. Turns out getting users to log in to Moodle straight from their homepage is fairly simple. 





Here’s how to add a Moodle login form to your main site (or external site):


1. Use this code on your external site:

<form class=”loginform” name=”login” method=”post” action=””>

<p>Username :

<input size=”10″ name=”username” />


<p>Password :

<input size=”10″ name=”password” type=”password” />



<input name=”Submit” value=”Login” type=”submit” />



Replace with your actual site URL.

2. Go to your Moodle admin and go down to “Site Administration” -> “Plugins” -> “Authentication” -> “Manage Authentication”

3. Scroll down to Alternate Login URL and enter your site URL here (the site you will be putting the login form to). 


Remember to style the ugly unstyled form up a bit to make it look nicer!

Post Author: Tom Pai