Exemplo n.º 1
0
// $CVSHeader: _freebeer/www/demo/HTML.LockFormFields.php,v 1.3 2004/03/08 04:29:18 ross Exp $
// Copyright (c) 2002-2004, Ross Smith.  All rights reserved.
// Licensed under the BSD or LGPL License. See license.txt for details.
// \todo fix wget's continuously reporting "End of file while parsing headers."
if (preg_match('/wget/i', $_SERVER['HTTP_USER_AGENT'])) {
    echo "<html><body></body></html>";
    exit(0);
}
require_once './_demo.php';
require_once FREEBEER_BASE . '/lib/HTML/LockFormFields.php';
echo html_header_demo('fbHTML_LockFormFields Class (Lock Selected Form Fields)');
$msg = 'Values in v1 and v2 are locked. Values in v3 and v4 can be modified.';
$locked_fields = array('textfield1', 'textfield2');
if (isset($_REQUEST['set'])) {
    $_REQUEST = fbHTML_LockFormFields::set($_REQUEST, $locked_fields);
} elseif (isset($_REQUEST['check'])) {
    if (fbHTML_LockFormFields::check($_REQUEST, $locked_fields)) {
        $msg = 'Values in v1 and v2 have not been modified.<br>';
    } else {
        $msg = '<b>WARNING: v1 and/or v2 have been modified.</b><br>';
    }
    //	$msg .= 'hash=' . fbHTML_LockFormFields::_generateHash($_REQUEST, $locked_fields);
    //	$msg .= "<br />\n";
} else {
    $_REQUEST['textfield1'] = 'Value1';
    $_REQUEST['textfield2'] = 'Value2';
    $_REQUEST['textfield3'] = 'Value3';
    $_REQUEST['textfield4'] = 'Value4';
}
?>