|
|
<?
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();
}
};
?> |
|
| Array Insertion Categories : PHP, PHP Classes, Arrays | | | A simple bubblesort that takes 2 arrays as argument.The first one is the actual data used for sorting, the second is data that will "tag along" with the first array, for instance a descriptive text about the data in the first array. Categories : Algorithms, Arrays, PHP, Complete Programs | | | Credit Card Identification and Validation Class - The credit_card class provides methods for cleaning, validating and identifying the type of credit card numbers. Categories : PHP, PHP Classes, Credit Cards, Ecommerce, Algorithms | | | Pageinfo: Array containing page URI, page query string (parameters), request method (GET or POST) and the complete URI Categories : Variables, PHP Options and Info, Arrays, URLs, PHP | | | Object() = Custom __autoload + Singleton. "automagically" instantiates a class and always retuns the same instance of the same class. It's pretty useful when you want to have persistence in objects. Categories : PHP, PHP Classes, Algorithms | | | A recursive function to traverse a multi-dimensional array where the
dimensions are not known Categories : Arrays, PHP, Algorithms | | | How to pass an array to a function, or how to define a
function wich recieves an array. Categories : Variables, PHP, Arrays | | | Password Creator: This PHP code exmaple shows how to use bitwise operations on a single variable and using it as a flagged variable. The class generates passwords of a given length using specified characters and the flags. Categories : PHP, PHP Classes, Algorithms, Security | | | Tweak Array, insert/add elements to any position of your arrays - delete elements from your arrays - move elements within your arrays - replace elements from your arrays ... the array, 'dynamically' grows or shrinks to whatever we tweak it. Categories : PHP Classes, Arrays, PHP | | | Sort the results from a SELECT query (any number of columns) into an array automatically. Categories : PHP, PHP Classes, Arrays, Databases, MySQL | | | Timer - a class that uses microtime() to provide easy calculation of elapsed times Categories : Algorithms, PHP, PHP Classes | | | Check parameters validity. Paranoia was designed to check the validity of the parameters that a php page will receive after a form submission. It can be used to check the variables sent by POST or GET Categories : Algorithms, HTML and PHP, PHP, Variables | | | quick sort for associative arrays Categories : Algorithms, Arrays, PHP | | | PHP Dump in html format the contents of one array variable with a recursive list of the nested array variables inside. Categories : PHP, Arrays, Variables | | | Dump the contents of a PHP variable in html format with a recursive list of subfolders and files from a given root directory.
Categories : PHP, Directories, Variables, Arrays | |
| |
| | | | | LooNeX Calp wrote : 62
Good... but what is it? :) hehe
| | | | babak bandpay wrote : 112
This would be much nicer with some comments, which
could explain all the fancy coding in it.
| | | | wrote : 155
Yeah.. what is it? ah?
| | | | wrote : 309
it takes the variables received through HTTP GET and POST methods
(ie, from a form) and prints them out as hidden inputs in another form.
this is useful for having a user fill out a form that spans multiple pages,
for example.
| | | | Frederic Jeanbart wrote :1228
Hmmmm... I have fired programmers from my team twice for not commenting anything about their work (and mostly for showing disdain about this IMPORTANT task when you work in any collaborative environment)... That situation made others loose a valuable amount of time, and in the end it was more easy to re-code instead of trying to figure out what the uncommented code did!!
No comments = loss of time when you are an experienced coeder reading someone else`s code... No comments = too bad, there is NOTHING here that awakens my curiosity. Sorry if this sounds rude, but hey, isn`t it rude towards your readers to present a code WITHOUT ANY COMMENT?!?!
| |
|
|