-
Notifications
You must be signed in to change notification settings - Fork 1
/
db.inc
executable file
·37 lines (34 loc) · 909 Bytes
/
db.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?
/************************************************************************************************
****
**** Author: Eric A. Bonney
**** Filename: db.inc
**** Date: May 31, 2009
**** Modified: June 4, 2009
****
*************************************************************************************************/
function showerror()
{
die( "Error " . mysql_error() . " : " . mysql_error() );
}
function mysqlclean( $array, $index, $maxlength, $connection )
{
if( isset( $array["{$index}"] ) )
{
$input = substr( $array["{$index}"], 0, $maxlength );
$input = mysql_real_escape_string( $input, $connection );
return ( $input );
}
return NULL;
}
function shellclean( $array, $index, $maxlength )
{
if( isset( $array["{$index}"] ) )
{
$input = substr( $array["{$index}"], 0, $maxlength );
$input = EscapeShellArg( $input );
return ( $input );
}
return NULL;
}
?>