GEK van GAPTCHA

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Takke

takke

12/12/2007 10:46:00
Quote Anchor link
Wat een k*t script/prog is dat CAPTCHA..

Ik heb een mail script en telkens als ik maar iets verander of de css aanpas werkt dat t**ring programma niet meer, iemand een idee wat ik hieraan kan doen..

Ik ben inmiddels als een stuk of tien keer opnieuw begonnen.

Wordt er gek van....

Is dit programma zo gevoelig ofzo
 
PHP hulp

PHP hulp

24/11/2024 11:24:14
 
Bart Tuma

Bart Tuma

12/12/2007 10:48:00
Quote Anchor link
Post eens je script, of google eens ;)
 
Jacco Engel

Jacco Engel

12/12/2007 10:51:00
Quote Anchor link
Begin even met tellen tot ongeveer 6394. :)
 
Takke

takke

12/12/2007 10:53:00
Quote Anchor link
Dit is de index van het contact script....
ik gebruik mozilla, ik ga het ook even proberen met ie6 misscien ligt het daaraan... ik weet het ook niet meer... Het gekke is dat ik helemaal niet aan GAPTCHA instellingen zit....

http://www.webbeezz.nl/mcontact


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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<?php

session_start();

define(MCONTACT, true);
$include_path = dirname(__FILE__); // Path to this file
require($include_path.'/config.php'); // Our flat file
require($include_path.'/contact_class.php');

// Variable setup
$passCap = false;
$contact = new Contact();


// Set up our session
if ( !isset($_SESSION['numTries']) ) {
    $_SESSION['numTries'] = 0;
}



// If we're using a CAPTCHA, set it up
if ( $M_CONTACT['usingCap'] ) {

    // From Gotcha 2.0
    if(isset($_POST['code'])){

        $text = isset($_SESSION['CAPTCHA'])? $_SESSION['CAPTCHA'] : NULL;

        if(!$p = trim($_POST['code'])){
            $passCap = false;
        }

        else if((strtolower($p)) != ($c = strtolower($text))){
            $passCap = false;
        }

        else{
            $passCap = true;
        }


        $_SESSION['CAPTCHA'] = NULL;
    }
    
}
else { // No CAPTCHA in use
    $passCap = true;
}




// If submitted is set, parse the form
if( isset($_POST['submitted']) && ($_POST['submitted'] == "submitted") ) {

    // Assume the message should be sent, find reasons not to send it.
    $sendMessage = true;

    /* Do some checking for bad input */
    if ( !$contact->isGoodName($_POST['name']) ) {
        $sendMessage = false;
    }

    if ( !$contact->isGoodAddress($_POST['address']) ) {
        $sendMessage = false;
    }
else if ( $contact->isBanned($_POST['address'], $_SERVER['REMOTE_ADDR']) ) {
        $sendMessage = false;
    }

    if ( !$contact->isGoodTo($_POST['to']) ) {
        $sendMessage = false;
    }

    if ( !$contact->isGoodSubject($_POST['subject']) ) {
        $sendMessage = false;
    }

    if ( !$contact->isGoodMessage($_POST['message']) ) {
        $sendMessage = false;
    }

    if ( isset($_POST['userFields']) && !$contact->isGoodUserFields($_POST['userFields']) ) {
        $sendMessage = false;
    }

    

    // Check for a valid code
    if($passCap == false) {
        $M_ERROR['badCode'][0] = true;
        $sendMessage = false;
    }

    

    // Looks good, send the message.
    if ( $sendMessage == true ) {
        $sendTo = "";
        $titles = "";

        // Clean all input before it is sent
        $cleaned['subject'] = trim( substr($_POST['subject'], 0, $M_CONTACT['maxSubject']) );
        $cleaned['message'] = trim( substr($_POST['message'], 0, $M_CONTACT['maxMessage']) );
        $cleaned['name']    = trim( substr($_POST['name'], 0, $M_CONTACT['maxName']) );
        $cleaned['address'] = trim( substr($_POST['address'], 0, $M_CONTACT['maxAddress']) );
        $cleaned['userFields'] = $_POST['userFields'];
        for ( $i=0; $i<count($_POST['userFields']); ++$i ) {
            $cleaned['userFields'][$i] = trim( substr($_POST['userFields'][$i], 0, $M_CONTACT['maxUser']) );
        }

        $cleaned['REMOTE_ADDR'] = $_SERVER['REMOTE_ADDR'];

        // Remove any extra headers
        $cleaned = $contact->removeHeaders($cleaned);

        // Create the list of people to send to
        for ($i=0; $i < count($_POST['to']); ++$i) {
        
            if ( $_POST['to'][$i] != 0 ) {
                // Get the to email address
                $sendTo .= $contact->getAddress($_POST['to'][$i]);

                // Get the title
                $titles .= $contact->getTitle($_POST['to'][$i]);

                //   Add a comma if there is more than one email address
                //   e.g. "Name" <[email protected]>, "Name2" <[email protected]>

                if( ( count($_POST['to'])>1 ) && ( ($i+1)<count($_POST['to']) ) ) {

                    $sendTo .= ", ";
                    $titles .= ",<br>\n";
                }
            }
            
        }
// end for()
    

        // Tack on some explanation of where the email came from.

        $cleaned['subject'] = "Message from {$M_CONTACT['siteName']}: {$cleaned['subject']}";

        // Write our headers.
        $cleaned['name'] = $contact->filterWords($cleaned['name']);
        $headers  = "From: \"{$cleaned['name']}\"\r\n";
        $headers .= "     <{$cleaned['address']}>\r\n";
        $headers .= "Reply-To: \"{$cleaned['name']}\"\r\n";
        $headers .= "     <{$cleaned['address']}>";

        // insert user fields
        if ( $M_USER[0][0] != "" ) {
            $cleaned['message'] .= "\n\nExtra informatie:";
            $cleaned['message'] .= "\n+---------------------------------------\n";

            // Attach each user field to the message
            for ( $i=0; $i<count($M_USER); ++$i ) {
                $cleaned['message'] .= "{$M_USER[$i][0]}: {$cleaned['userFields'][$i]}\n";
            }


            $cleaned['message'] .= "+---------------------------------------\n";
        }


        // This is the signature attached to each message:
        $cleaned['message'] .= "\n--------------------------------------------------\n";
        $cleaned['message'] .= "Dit bericht is verzonden door: {$cleaned['address']}\n";
        $cleaned['message'] .= "op ".date("M jS, Y \a\\t g:i A")." van {$M_CONTACT['siteName']}.\n";
        $cleaned['message'] .= "Van IP adres:{$cleaned['REMOTE_ADDR']}\n";
        $cleaned['message'] .= "--------------------------------------------------\n";

        // Apply the word filter
        $cleaned['message'] = $contact->filterWords($cleaned['message']);
        $cleaned['subject'] = $contact->filterWords($cleaned['subject']);

        // Make sure there are no lines longer than 70 chars
        $cleaned['message'] = wordwrap($cleaned['message'], 70, "\n", 1);

        // Remove formatting added by magic quotes
        $cleaned['subject'] = stripslashes($cleaned['subject']);
        $sendTo  = stripslashes($sendTo);
        $titles  = stripslashes($titles);
        $cleaned['message'] = stripslashes($cleaned['message']);

        // Send the message.
           mail( $sendTo, $cleaned['subject'], $cleaned['message'], $headers );

        // Send the admin message
           if ( $M_CONTACT['trigger'] && ($M_CONTACT['adminEmail'] != "") ) {
            mail( $M_CONTACT['adminEmail'],
                "{$M_CONTACT['siteName']} - Message Sent",
                "A message from {$cleaned['address']} at {$cleaned['REMOTE_ADDR']}".
                " has been sent to: \n$sendTo\n on ".date("M jS, Y \a\\t g:i A").
                " from the contact script installed at {$M_CONTACT['siteName']}.",
                "From: {$M_CONTACT['adminEmail']}");
           }


        // Not used anymore, distroy them
           unset($sendTo, $headers);
        unset($GLOBALS['_SESSION']['numTries']);
        unset($GLOBALS['_SESSION']['CAPTCHA']);
        
        // Show the user what we've sent, include the sent template.
        include($include_path.'/templates/'.$M_CONTACT['template'].'/sent_page.php');

    }
else { // There was an error somewhere

        ++$_SESSION['numTries'];

        // To many tries!
        if ( $_SESSION['numTries'] >= $M_CONTACT['maxAttempts'] ) {

            $M_ERROR['toManyErrors'][0] = true;

            // Destroy the post values
            $postArray = array('code', 'submitted', 'name', 'address', 'to',
                            'subject', 'message', 'userFields');
            foreach ( $postArray as $post ) {
                unset($GLOBALS['_POST'][$post]);
            }


            // Destroy our session values
            unset($GLOBALS['_SESSION']['numTries']);
            unset($GLOBALS['_SESSION']['CAPTCHA']);
            
            sleep(5);

        }
else { // The user has more tries, give a hint and continue.

            // Remove formatting added by magic quotes

            $_POST['name']      = stripslashes($_POST['name']);
            $_POST['address']   = stripslashes($_POST['address']);
            $_POST['subject']   = stripslashes($_POST['subject']);
            $_POST['message']   = stripslashes($_POST['message']);

            // Stop special characters from messing up our form.
            $_POST['name']      = htmlspecialchars($_POST['name'], ENT_QUOTES);
            $_POST['address']   = htmlspecialchars($_POST['address'], ENT_QUOTES);
            $_POST['subject']   = htmlspecialchars($_POST['subject'], ENT_QUOTES);
            $_POST['message']   = htmlspecialchars($_POST['message'], ENT_QUOTES);

            // Now fix the custom fields
            if ( $M_USER[0][0] != "" ) {
                foreach ( $_POST['userFields'] as $key => $value ) {
                    $_POST['userFields'][$key] = stripslashes($value);
                    $_POST['userFields'][$key] = htmlspecialchars($value, ENT_QUOTES);
                }
            }

        }
// end if( $_SESSION['numTries'] >= $maxAttempts ) {

        // Now print the form again.

        include($include_path.'/templates/'.$M_CONTACT['template'].'/contact_form.php');

    }
// end if ( $sendMessage == true ) {

} else {
    // Print out the form for the first time.
    include($include_path.'/templates/'.$M_CONTACT['template'].'/contact_form.php');

}
// end if ( isset($_POST['submitted']) ) {


?>
 



Overzicht Reageren

 
 

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.