diff options
| author | Stephan Poehlsen <stephan@poehlsen.net> | 2005-11-23 02:25:01 +0000 |
|---|---|---|
| committer | Stephan Poehlsen <stephan@poehlsen.net> | 2005-11-23 02:25:01 +0000 |
| commit | e362e8beb12b18b2ef1988770128fbdaec9e265d (patch) | |
| tree | 0dcc220d7900c4caf3cfc6adcd57915db0864c9b /www/_main.inc.php | |
| parent | 72af90dbe17e3e0a1534f85e3f7af4e49ec7ac0f (diff) | |
erste Version vom Webinterface
git-svn-id: file:///home/lennart/svn/public/sse/trunk@34 5fbabb74-0606-0410-a5e4-b5cc6a42724e
Diffstat (limited to 'www/_main.inc.php')
| -rw-r--r-- | www/_main.inc.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/www/_main.inc.php b/www/_main.inc.php new file mode 100644 index 0000000..9068d69 --- /dev/null +++ b/www/_main.inc.php @@ -0,0 +1,33 @@ +<?php + +function db_escape($s) { return mysql_escape_string($s); } + +function db_connect() { + mysql_pconnect('localhost', 'sse_ro', 'Shu5ahdo'); + mysql_select_db('sse'); +} + +function split_q($q) { + $q = preg_replace('/[^a-zA-Z0-9_\s]/', '', trim($q)); + return preg_split('/\s/', $q, -1, PREG_SPLIT_NO_EMPTY); +} + +function stripslashes_deep($value) { + if (!is_array($value)) return stripslashes($value); + $n = array(); + foreach ($value as $k => $v) { + $n[stripslashes($k)] = stripslashes_deep($v); + } + return $n; +} + +if (get_magic_quotes_gpc()) { + $_REQUEST = array_map('stripslashes_deep', $_REQUEST); + $_POST = array_map('stripslashes_deep', $_POST); + $_GET = array_map('stripslashes_deep', $_GET); + $_COOKIE = array_map('stripslashes_deep', $_COOKIE); +} + +$num_default = 25; + +?>
\ No newline at end of file |
