Forum Moderators: coopster
i use this statement:
$sql = 'SELECT * from registration_table ORDER by last_name ASC';
I have several other fields that are displayed also, First Name, Address, City.....etc...etc.
How can i make this table sortable by any column that my users wnat?
Can i do that with submit buttons?
$ORDER_BY = $_REQUEST['field_name'];
$sql = "SELECT * from registration_table ORDER by ". $ORDER_BY ." ASC";
Habtom
To secure a switch
You may use for example:
$state=$_POST['state'];
$clean_state = array();
switch ($_POST['state'])
{
case 'ct':
case 'ma':
case 'ny':
$clean_state['state'] = ($_POST['state']);
break;
}
$state=$clean_state['state'];
if ($state!=$clean_state['state'])
{
echo" <h1>We are aware of the tentative intrusion in State options</h1><br>";
exit();
}
[kryogenix.org...]
Hidden fields are vulnerable as well;
you need to verify that the data received is the data expected
Hidden fields are irrelevant here. Use a switch to explicitly declare input (like the example with the $clean_state array above) and then default if none are met. In an inconsequential situation like this there’s no need and/or point to break from the system to tell someone you are aware of their mischief.