diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-09-11 17:36:10 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-09-11 18:22:17 -0300 |
commit | 111bea0dc4524dac0f36d45acff8eedff3f99f5c (patch) | |
tree | 05c431adf2a91e947ebdba23c63f00f6064ed59e /etc | |
parent | d83a4264b7b93393fb89cf2e99ac364de0236dc1 (diff) | |
download | pfsense-111bea0dc4524dac0f36d45acff8eedff3f99f5c.zip pfsense-111bea0dc4524dac0f36d45acff8eedff3f99f5c.tar.gz |
Add a function to redirect to a page passing parameters through POST
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/util.inc | 13 |
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"; +} + ?> |