Changes

Jump to: navigation, search

Adding the SmartSimple Login to your Website

1,145 bytes added, 16:07, 1 June 2009
no edit summary
Note: you can redirect users to any page that you wish, not just the custom login page.
== Returning invalid login error message==
If you wish to return an invalid username or password error message to your login page you can place the
following script in the head portion of your login page.
 
You can change the “Invalid Username or Password.” message located in the showmsg function to
whatever message you wish to display.
<pre>
<script language=javascript>
function _getrequestvar(name)
{ var url= location.href;
var hasQueryString = url.indexOf('?');
if (hasQueryString != -1)
return url.substring(hasQueryString+2+name.length ).replace(/%20/g,'
').replace(/\+/g,' ');
else
return "";
}
function showmsg()
{
if( _getrequestvar('errmsg').length>0)
return "Invalid Username or Password.";
else
return "";
}
</script> </pre>
 
Additionally you will need to place this second script within the area you wish the error message to be
printed.
<pre>
<script language="javascript">
document.write(showmsg());
</script></pre>
 
Alternatively, if you are using a server page as your login page you can choose to use the parameter
“errmsg=Invalid+User+Login.” which is passed back to your page in order to display the error message.
[[Category:System Management]][[Category:JavaScript Examples]]
Smartstaff
137
edits

Navigation menu