sentry

Gesponsorde koppelingen

PHP script bestanden

  1. sentry

« 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
<?php
##
## SENTRY_CLASS.PHP
## Checking all user input
## By Dave Bronckers


class Sentry{

    ## SENTRY CONFIGURATION
    ## 1 = enabled
    ## 0 = disabled


    private $enable = 1;



    ## NO EDITTING BEHIND
    ## THIS COMMENT


    public function __construct(){

        if( $this->enable == 0){

            $this->__destruct();
        }

    }

    public function validateNum( $input ){

        if( !is_numeric( $input )){

            throw new Exception( 'Invoer is niet numeriek.' );

        }
    }

    public function validateMix( $input ){

        if(!preg_match( '/^[a-z0-9]+$/', $input)){

            throw new Exception( 'Gebruikersgegevens zijn niet correct.' );

        }

    }

    public function validateString( $input ){

        if(!preg_match( '/^[a-z0-9]+$/', $input)){

            throw new Exception( 'Invoer is niet alfabetisch.' );

        }

    }

    public function validateEmail( $input ){

        if(!preg_match( '/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)*\.([a-zA-Z]{2,6})$/', $input )){

            throw new Exception( 'Invoer bevat verboden tekens.');

        }
    }

    public function validateMinCharCount( $input, $limit ){

        if(strlen($input) < $limit){

            throw new Exception( 'Invoer bevat onvoldoende tekens. Minimaal ' . $limit . ' tekens vereist.');

        }
    }

    public function validateMaxCharCount( $input, $limit ){

        if(strlen($input) > $limit){

            throw new Exception( 'Invoer bevat teveel tekens. Maximaal ' . $limit . ' tekens toegestaan.');

        }
    }
}

?>

 
 

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.