summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-09-11 17:36:10 -0300
committerRenato Botelho <garga@FreeBSD.org>2014-09-11 18:22:17 -0300
commit111bea0dc4524dac0f36d45acff8eedff3f99f5c (patch)
tree05c431adf2a91e947ebdba23c63f00f6064ed59e
parentd83a4264b7b93393fb89cf2e99ac364de0236dc1 (diff)
downloadpfsense-111bea0dc4524dac0f36d45acff8eedff3f99f5c.zip
pfsense-111bea0dc4524dac0f36d45acff8eedff3f99f5c.tar.gz
Add a function to redirect to a page passing parameters through POST
-rw-r--r--etc/inc/util.inc13
1 files changed, 13 insertions, 0 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index e672970..bf77e95 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -2022,4 +2022,17 @@ function prefer_ipv4_or_ipv6() {
mwexec("/etc/rc.d/ip6addrctl prefer_ipv6");
}
+/* Redirect to page passing parameters via POST */
+function post_redirect($page, $params) {
+ if (!is_array($params))
+ return;
+
+ print "<html><body><form action=\"{$page}\" name=\"formredir\" method=\"post\">\n";
+ foreach ($params as $key => $value) {
+ print "<input type=\"hidden\" name=\"{$key}\" value=\"{$value}\" />\n";
+ }
+ print "</form><script type=\"text/javascript\">document.formredir.submit();</script>\n";
+ print "</body></html>\n";
+}
+
?>
OpenPOWER on IntegriCloud