", etc.) properly quoted, * or if $var is undefined, will return an empty string. note this function * must be called with a variable, for normal strings or functions use o() */ return isset($var) ? htmlSpecialChars(stripslashes($var)) : ""; } function pv(&$var) { /* prints $var with the HTML characters (like "<", ">", etc.) properly quoted, * or if $var is undefined, will print an empty string. note this function * must be called with a variable, for normal strings or functions use p() */ echo isset($var) ? htmlSpecialChars(stripslashes($var)) : ""; } function o($var) { /* returns $var with HTML characters (like "<", ">", etc.) properly quoted, * or if $var is empty, will return an empty string. */ return empty($var) ? "" : htmlSpecialChars(stripslashes($var)); } function p($var) { /* prints $var with HTML characters (like "<", ">", etc.) properly quoted, * or if $var is empty, will print an empty string. */ echo empty($var) ? "" : htmlSpecialChars(stripslashes($var)); } function db_query_loop($query, $prefix, $suffix, $found_str, $default="") { /* this is an internal function and normally isn't called by the user. it * loops through the results of a select query $query and prints HTML * around it, for use by things like listboxes and radio selections * * NOTE: this function uses dblib.php */ $output = ""; $result = db_query($query); while (list($val, $label) = db_fetch_row($result)) { if (is_array($default)) $selected = empty($default[$val]) ? "" : $found_str; else $selected = $val == $default ? $found_str : ""; $output .= "$prefix value='$val' $selected>$label$suffix"; } return $output; } function db_listbox($query, $default="", $suffix="\n") { /* generate the