Skip to content

Instantly share code, notes, and snippets.

@reinforchu
Last active January 21, 2021 03:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reinforchu/cf0ed710946f0af8ed4895ed68962aca to your computer and use it in GitHub Desktop.
Save reinforchu/cf0ed710946f0af8ed4895ed68962aca to your computer and use it in GitHub Desktop.
file:///Users/reinforchu/Desktop/autoPost.html?login=taro&password=1234
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="cache-control" content="no-cache, no-store">
<meta http-equiv="pragma" content="no-cache">
<meta name="expires" content="0">
<title>Auto Login Demo</title>
</head>
<body>
<h1>Login</h1>
<form action="http://localhost/login.php" name="auto" method="get">
<input type="text" id="user" name="id" value="">
<input type="password" id="pwd" name="pw" value="">
</form>
<script>
var p = window.location.search.substring(1).split('&');
for( var i = 0; i < p.length; i++ ) {
var e = p[i].split('=');
if (i === 0) user.value=decodeURIComponent(e[1]); else pwd.value=decodeURIComponent(e[1]);
}
document.auto.submit();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment