Snippet Name: GET and POST variables in hidden form
Description: A class to put get and post variables in hidden form.
Comment: (none)
Language: PHP
Highlight Mode: PHP
Last Modified: March 01st, 2009
|
<? php
CLASS c_HiddenVars {
FUNCTION display($a) {
$c = COUNT($a);
FOR ($i = 0, RESET($a); $i < $c; $i++, NEXT($a)) {
$k = KEY($a); $v = $a[$k];
IF (IS_ARRAY($v)) {
$vc = COUNT($v);
FOR (RESET($v), $vi = 0; $vi < $vc; $vi++, NEXT($v)) {
$vk = KEY($v);
ECHO "<input type=hidden name=\"$k\[$vk\]\" value=\"".HTMLSPECIALCHARS($v
[$vk]). "\">\n";
}
} ELSE {
ECHO "<input type=hidden name=\"$k\" value=\"".HTMLSPECIALCHARS($v). "\">\n";
}
}
}
FUNCTION get() {
GLOBAL $HTTP_GET_VARS;
IF (IS_ARRAY($HTTP_GET_VARS)) { $this->display
($HTTP_GET_VARS); }
}
FUNCTION post() {
GLOBAL $HTTP_POST_VARS;
IF (IS_ARRAY($HTTP_POST_VARS)) { $this->display
($HTTP_POST_VARS); }
}
FUNCTION all() {
$this->get();
$this->post();
}
};
?> |