Enumerate the values of each request variable in PHP
The $_REQUEST predefined variable is an array consisting of the contents of $_GET, $_POST, and $_COOKIE.
To enumerate through each value in this array use the following:
foreach($_REQUEST as $key => $value) {
echo "key: $key value: $value<br>";
}
How to Get URL Page Name in PHP
$file = basename($_SERVER[’PHP_SELF’]);
Will return the file name with extension;
There is a way to get the file name without extension too:
http://ca3.php.net/manual/en/function.basename.php
Here is how I use the MySql date field.
I created a field of date type in the existing table as follows:
ALTER TABLE tableName ADD COLUMN crdate DATE;
The current date is inserted using the now() function:
INSERT INTO tableName (field1, crdate) VALUES (’value1′, NOW())
Then, the rows with the current date are selected using the curdate() function:
SELECT * FROM tableName WHERE crdate = CURDATE();
