[Phpmyadmin-devel] how to set variables from $_REQUEST
Marc Delisle
Marc.Delisle at cegepsherbrooke.qc.ca
Wed Jan 4 10:34:10 CET 2006
Hi,
here is what I did in tbl_change.php:
/**
* Sets global variables.
* Here it's better to use a if, instead of the '?' operator
* to avoid setting a variable to '' when it's not present in $_REQUEST
*/
if (isset($_REQUEST['pos'])) {
$pos = $_REQUEST['pos'];
}
if (isset($_REQUEST['session_max_rows'])) {
$session_max_rows = $_REQUEST['session_max_rows'];
}
if (isset($_REQUEST['disp_direction'])) {
$disp_direction = $_REQUEST['disp_direction'];
}
if (isset($_REQUEST['repeat_cells'])) {
$repeat_cells = $_REQUEST['repeat_cells'];
}
if (isset($_REQUEST['dontlimitchars'])) {
$dontlimitchars = $_REQUEST['dontlimitchars'];
}
if (isset($_REQUEST['primary_key'])) {
$primary_key = $_REQUEST['primary_key'];
}
if (isset($_REQUEST['sql_query'])) {
$sql_query = $_REQUEST['sql_query'];
}
-----------
I had to get variables from $_REQUEST to fix bug #1381856.
I think we'll have to do this everywhere, to avoid getting "undefined
variable" errors when fetching something that might not be present in
$_REQUEST.
Comments?
Marc
More information about the Developers
mailing list