Add Moodle login form to external site
A 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="http://yoursite.com/moodle/login/index.php">
<input size="10" name="username" />
<input size="10" name="password" type="password" />
<input name="Submit" value="Login" type="submit" />
Replace yoursite.com 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!