Это то, что я использовал:
<script type="text/javascript">
function QueryString(key) {
//Get the full querystring
fullQs = window.location.search.substring(1);
//Break it down into an array of name-value pairs
qsParamsArray = fullQs.split("&");
//Loop through each name-value pair and
//return value in there is a match for the given key
for (i=0;i<qsParamsArray.length;i++) {
strKey = qsParamsArray[i].split("=");
if (strKey[0] == key) {
return strKey[1];
}
}
}
//Test the output (Add ?fname=Cheese&lname=Pizza to your URL)
//You can change the variable to whatever it is you need to do for example, you could
//change firstname to id and lastname to userid and just change the reference in the
//document.write/alert box
var firstname = QueryString("fname");
var lastname = QueryString("lname");
document.write("You are now logged in as " + firstname + " " + lastname + "!");
</script>
Вы можете заменить document.write на предупреждение, и вместо этого появится окно с предупреждением!
Я использовал это на своем сайте.Это еще не сделано, но когда это произойдет, это будет на zducttapestuff.com
Вывод будет выглядеть следующим образом: Вы вошли в систему как Cheese Pizza!так как пароль будет показан в URL.