How do I implement this?
<p>I found this script but I don't know if I'm making a mistake or if it has an error. 
What do I need to do to make it work? Do I need to link to any extra files or anything? I'm using php. Thanks</p>

<pre><code>&lt;a href=”JavaScript:login(user, pass, 'http://www.example_login.com')"&gt;
Protected Web Site
&lt;/a&gt;

&lt;script&gt;
function getHTTPObject() {

  var xmlhttp = false;
  if (typeof XMLHttpRequest != 'undefined') {
        try {
              xmlhttp = new XMLHttpRequest();
        } catch (e) {
              xmlhttp = false;
        }
  } else {
    /*@cc_on
    @if (@_jscript_version &gt;= 5)
        try {
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (E) {
                xmlhttp = false;
            }
        }
    @end @*/
  }
  return xmlhttp;
}

function login(username, password, url) {
var http = getHTTPObject();
http.open("get", url, false, username, password);
http.send("");
  if (http.status == 200) {
        document.location = url;
  } else {
    alert("No access to the secured web site");
}
return false;
}
var user = "&lt;SOMEUSER&gt;"
var pass = "&lt;SOMEPASS&gt;"
&lt;/script&gt;
</code></pre>
