4 * These are a handful of useful utilities
5 * Functions that don't belong anyplace else at
6 * the moment end up here
11 * Pad the end of a string with up to
12 * the max length of the string
15 function NBSPPadSuffix($strInfo, $intMaxLength)
17 $intN = $intMaxLength - strlen($strInfo);
20 $strInfo = sprintf("%s ", $strInfo);
29 * properly quote the passed value
30 * or return NULL if there is no value at all
32 function SQLQuote($strValue)
34 /* are we quoting a number or string? */
36 if (is_string($strValue) == true) {
39 if (strlen($strValue) == 0) {
43 if ($strValue == null) {
47 /* remove any '\' values */
48 $strValue = preg_replace("/\\\/", '', $strValue);
49 return "'". preg_replace("/\'/", "''", $strValue) ."'";
53 if (is_null($strValue)) {
67 * Get the HTML (GET or POST) parameters
70 function GetParameters()
72 if ($_SERVER["REQUEST_METHOD"]=="POST") {
73 foreach ($_POST as $key => $value) {
74 // echo $key."=".$value."<br>\n";
75 $parameters[$key] = $value;
77 } else if ($_SERVER["REQUEST_METHOD"]=="GET") {
78 foreach ($_GET as $key => $value) {
79 $parameters[$key] = $value;