!C99Shell v. 2.1 [PHP 8 Update] [02.02.2022]!

Software: Apache/2.4.53 (Unix) OpenSSL/1.1.1o PHP/7.4.29 mod_perl/2.0.12 Perl/v5.34.1. PHP/7.4.29 

uname -a: Linux vps-2738122-x 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 

uid=1(daemon) gid=1(daemon) grupos=1(daemon) 

Safe-mode: OFF (not secure)

/opt/lampp/lib/php/doc/HTML_QuickForm/docs/   drwxr-xr-x
Free 13.77 GB of 61.93 GB (22.24%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     rules-custom.php (3.92 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * Usage example for HTML_QuickForm, using custom validation rules.
 *
 * @category    HTML
 * @package     HTML_QuickForm
 * @author      Alexey Borzov <avb@php.net>
 * @version     CVS: $Id: rules-custom.php 236645 2007-05-29 19:12:26Z avb $
 * @ignore
 */

require_once 'HTML/QuickForm.php';
require_once 
'HTML/QuickForm/Rule.php';

/**
 * Checks that a numeric value is within range 
 *
 * @package HTML_QuickForm
 * @ignore
 */
class RuleNumericRange extends HTML_QuickForm_Rule
{
    function 
validate($value$options)
    {
        if (isset(
$options['min']) && floatval($value) < $options['min']) {
            return 
false;
        }
        if (isset(
$options['max']) && floatval($value) > $options['max']) {
            return 
false;
        }
        return 
true;
    }

    function 
getValidationScript($options null)
    {
        
$jsCheck = array();
        if (isset(
$options['min'])) {
            
$jsCheck[] = 'Number({jsVar}) >= ' $options['min'];
        }
        if (isset(
$options['max'])) {
            
$jsCheck[] = 'Number({jsVar}) <= ' $options['max'];
        }
        return array(
''"{jsVar} != '' && !(" implode(' && '$jsCheck) . ')');
    } 
// end func getValidationScript
}

// In case you are wondering, this checks whether there are too many
// CAPITAL LETTERS in the string
function countUpper($value$limit null)
{
    if (empty(
$value)) {
        return 
false;
    }
    if (!isset(
$limit)) {
        
$limit 0.5;
    }
    
$upper array_filter(preg_split('//'$value, -1PREG_SPLIT_NO_EMPTY), 'ctype_upper');
    return (
count($upper) / strlen($value)) <= $limit;
}

// BC thingie: it expects the first param to be element name
function countUpper_old($name$value$limit null)
{
    if (empty(
$value)) {
        return 
false;
    }
    if (!isset(
$limit)) {
        
$limit 0.5;
    }
    
$upper array_filter(preg_split('//'$value, -1PREG_SPLIT_NO_EMPTY), 'ctype_upper');
    return (
count($upper) / strlen($value)) <= $limit;
}

$form =& new HTML_QuickForm('custom');

$form->addElement('header'null'Custom rule class');

// registering the custom rule class
$form->registerRule('numRange'null'RuleNumericRange');
$form->addElement('text''rNumber_1_10''The number (1-10):');
$form->addRule('rNumber_1_10''Enter number from 1 to 10''numRange', array('min' => 1'max' => 10), 'client');

// adding an instance of the custom rule class without registering
$form->addElement('text''rNonnegative''Nonnegative number:');
$form->addRule('rNonnegative''Enter nonnegative number', new RuleNumericRange(), array('min' => 0), 'client');

// adding a classname of the custom rule class without registering
$form->addElement('text''rNonpositive''Nonpositive number:');
$form->addRule('rNonpositive''Enter nonpositive number''RuleNumericRange', array('max' => 0), 'client');

$form->addElement('header'null'Using callbacks');

// using callback without registering
$form->addElement('text''rUpper_0_5''Some (preferrably lowercase) text:');
$form->addRule('rUpper_0_5''There are too many CAPITAL LETTERS''callback''countUpper');

// register with 'callback' type
$form->registerRule('upper''callback''countUpper');
$form->addElement('text''rUpper_0_25''Some (mostly lowercase) text:');
$form->addRule('rUpper_0_25''There are too many CAPITAL LETTERS''upper'0.25);

// BC feature: register with 'function' type
$form->registerRule('upperOld''function''countUpper_old');
$form->addElement('text''rUpper_0''Some lowercase text:');
$form->addRule('rUpper_0''There are CAPITAL LETTERS, this is not allowed''upperOld'0);

$form->addElement('submit'null'Send');

$form->applyFilter(array('rUpper_0_5''rUpper_0_25''rUpper_0'), 'trim');
$form->applyFilter(array('rNumber_1_10''rNonnegative''rNonpositive'), 'floatval');

$form->validate();

$form->display();
?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.1 [PHP 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 0.4758 ]--