meerdere-functies-in-1

Gesponsorde koppelingen

PHP script bestanden

  1. meerdere-functies-in-1

« Lees de omschrijving en reacties

Code (php)
PHP script in nieuw venster Selecteer het PHP script
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
/*********************************************
 **   Multi functional function.
 **   By Kjarli
 **   Bugs or suggestions?
 **   kjarli@gmail.com
 **
 **   Leave the comments intact for legal use.
 **  
 **   Version 1.00
 **
 **   If you use md5 or sha1, please dont mix
 **   up other functions. It may result a
 **   wrong md5 or sha1 value.
 *********************************************/

/***
 * Star the Multi functional function
 ***/

function multiFunc
(                               // Position // default //
                                //----------//---------//

    $value,                     //    1     // $string //
    $mysql_real_escape_string,  //    2     //  false  //
    $addslashes,                //    3     //  false  //
    $stripslashes,              //    4     //  false  //
    $nl2br,                     //    5     //  false  //
    $htmlentities,              //    6     //  false  //
    $htmlspecialchars,          //    7     //  false  //
    $md5,                       //    8     //  false  //
    $sha1                       //    9     //  false  //
                                //----------//---------//

)
{

    /***
     * Used to protect from SQL injection.
     ***/

    if($mysql_real_escape_string)
    {

        if (get_magic_quotes_gpc())
        {

             $value = stripslashes($value);
        }

        if (!is_numeric($value))
        {

            $value = '\'' . mysql_real_escape_string($value) . '\'';
        }
    }

    
    /***
     * Add slashes to ' values.
     ***/

    if($addslashes)
    {

        $value = addslashes($value);
    }

    
    /***
     * Strip slashes from values.
     ***/

    if($stripslashes)
    {

        $value = stripslashes($value);
    }

    
    /***
     * Replaces newlines with <br />.
     ***/

    if($nl2br)
    {

        $value = nl2br($value);
    }

    
    /***
     * htmlentities to filter html from text.
     ***/

    if($htmlentities)
    {

        $value = htmlentities($value);
    }

    
    /***
     * htmlspecialchars to filter html from text.
     ***/

    if($htmlspecialchars)
    {

        $value = htmlspecialchars($value);
    }

    
    /***
     * Used to encode values.
     ***/

    if($md5)
    {

        $value = md5($value);
    }

    
    /***
     * Used to encode values.
     ***/

    if($sha1)
    {

        $value = sha1($value);
    }

    return $value;
}


?>

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.