WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Mobile Dev World

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : A class to put get and post variables in hidden form elements. Works on scalars, normal arrays, associative arrays.
Categories : Algorithms, Variables, Arrays, PHP, PHP Classes Update Picture
David Sklar
Date : Jan 16th 1999
Grade : 2 of 5 (graded 29 times)
Viewed : 30697
File : No file for this code example.
Images : No Images for this code example.
Search : More code by David Sklar
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

<?

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();
}
};

?>



Variable serialization and unserialization. Loading and saving variable structures to and from file.
Categories : Arrays, Filesystem, Variables, Strings, PHP
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
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
A recursive function to traverse a multi-dimensional array where the dimensions are not known
Categories : Arrays, PHP, Algorithms
clearing variables in php3
Categories : Variables, Arrays, PHP
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
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
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
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
Sort the results from a SELECT query (any number of columns) into an array automatically.
Categories : PHP, PHP Classes, Arrays, Databases, MySQL
How to pass an array to a function, or how to define a function wich recieves an array.
Categories : Variables, PHP, Arrays
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
Timer - a class that uses microtime() to provide easy calculation of elapsed times
Categories : Algorithms, PHP, PHP Classes
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
quick sort for associative arrays
Categories : Algorithms, Arrays, PHP
 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?!?!