", htmlspecialchars(">"), $str);
$str = str_replace("'", htmlspecialchars("'"), $str);
$str = str_replace("\"", htmlspecialchars("\""), $str);
return($str);
}
/**
* Helper function to create form fields, not to be called directly,
* only by other functions below.
*/
function addInputField($type, $name = null, $value = null, $attributes = '') {
// return '\n";
global $default_charset;
if ($default_charset == "utf-8") {
return '\n";
} else {
return '\n";
}
}
/**
* Password input field
*/
function addPwField($name , $value = null) {
return addInputField('password', $name , $value);
}
/**
* Form checkbox
*/
function addCheckBox($name, $checked = false, $value = null) {
return addInputField('checkbox', $name, $value,
($checked ? ' checked="checked"' : ''));
}
/**
* Form radio box
*/
function addRadioBox($name, $checked = false, $value = null) {
return addInputField('radio', $name, $value,
($checked ? ' checked="checked"' : ''));
}
/**
* A hidden form field.
*/
function addHidden($name, $value) {
return addInputField('hidden', $name, $value);
}
/**
* An input textbox.
*/
function addInput($name, $value = '', $size = 0, $maxlength = 0) {
$attr = '';
if ($size) {
$attr.= ' size="'.(int)$size.'"';
}
if ($maxlength) {
$attr.= ' maxlength="'.(int)$maxlength .'"';
}
return addInputField('text', $name, $value, $attr);
}
/**
* Function to create a selectlist from an array.
* Usage:
* name: html name attribute
* values: array ( key => value ) ->