I have this code right here:
<html>
<body style="color:white;background-color:#222222">
<center>
<br>
<input type="text" id="username"> Username</input>
<br>
<input type="text" id="password"> Password</input>
<br><br>
<button onclick="test()">Submit</button>
<p id="url"/>
<script type="text/javascript">
function test(){
var userInput = document.getElementById("username").value;
var userPass = document.getElementById("password").value;
document.getElementById("url").innerHTML = encodeURI('http://'+userInput+':'+userPass+'@'+window.location.hostname+':81/Home/');
}
</script>
</center>
</body>
</html>
It outputs an url that works. It logs me into my password-protected folders when I specify the right password.
Only problem, I want the “Submit” button to automaticly redirect me to the specified page instead of showing me the url.
I tried everything.
Please help.
Thanks.
2
Answers
Please check this:
Instead of
make it