Skip to content

Instantly share code, notes, and snippets.

@hasufell
Created December 4, 2015 00:01
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 hasufell/9d4e5cd46697b2960826 to your computer and use it in GitHub Desktop.
Save hasufell/9d4e5cd46697b2960826 to your computer and use it in GitHub Desktop.
-- |A magical hidden redirect page, that sends a POST request to the
-- given link.
redirectPostPage :: String -> DDXML
redirectPostPage link =
<html>
<head>
<style type="text/css"> form { display: none; } </style>
</head>
<body>
<form id="redirect" method="post" action=(pack link)>
<input type="submit" id="submitButton" />
</form>
<script type="text/javascript">
document.getElementById("redirect").submit()
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment