Ga naar inhoud
Log in om dit te volgen  
jesse

gratis scripts.

Aanbevolen berichten

Ik hoop dat we elkaar kunnen helpen door in dit topic scripts te dumpen ( zet er wel bij wat het is )

Deel dit bericht


Link naar bericht
Delen op andere sites
bron webmasterz.nl ip ban scripts:


Codeblok:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
iplijst.php<?
$ip[]="Hier een ip-adres";  ////Je kan nog meer ips toevoegen door de zin te herhalen met een ander ip adres
?>


De pagina, waar mensen die geband zijn niet kunnen komen:<?
include("iplijst.php");
if(in_array($_SERVER[REMOTE_ADDR], $ip)) {
  echo "Je bent geband van deze site";  
}
else {
  ////Hier kan je je site neer zetten
}
?>
Of dit script, deze moet je dan bij je index zetten (dan gaat het bannen over alle paginas):<?
include("iplijst.php");
if(in_array($_SERVER[REMOTE_ADDR], $ip)) {
  exit("Je bent geband van deze site");

Deel dit bericht


Link naar bericht
Delen op andere sites
Ja ik was ff op zoek naar die code smiley weet hem niet meer uit mijn hoofd ging in pbtjes kijken maar ehum moet ik ver zoeken smiley wat was die code ook alweer daarvan? smiley

Deel dit bericht


Link naar bericht
Delen op andere sites
kijk verder dan je neus lang is,
Bij Snel reageren zie je hem zelfs

kijk eens dat knopje onder b

het is gewoon
Codeblok:
1
[code] [/code]

Deel dit bericht


Link naar bericht
Delen op andere sites
Enne, habbospeed, heb je die wel zelf gemaakt? Anders ff copyright erbij plaatsen avan de eigenaar smiley

Deel dit bericht


Link naar bericht
Delen op andere sites
ik heb nog iets, ff geduld smiley
Codeblok:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
$copy
= "&copy;"; // Copyright tekentje of iets anders als je dat wilt
$einddate = date("Y"); // Dit jaar
$startdate = 2008; // Begin jaar
$naam = "SiteNaam"; // Naam van site
$rights = "Alle rechten voorbehouden."; // Rechten tekst

if ($einddate <= $startdate) {
   echo $copy . " " . $startdate . " " . $naam . ". " . $rights;
}

else {
   echo $copy . " " . $startdate . "-" . $einddate . " " . $naam . ". " . $rights;
}

?>


Voor de noobs onder ons is dit gewoon te makkelijk =]

Deel dit bericht


Link naar bericht
Delen op andere sites
Zet er aub ook bij wat het is en dit is toch gewoon copyright die automatisch veranderd? elk jaar?

Deel dit bericht


Link naar bericht
Delen op andere sites
Codeblok:
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
<?php
/**
* Luckys Captcha v3
*
* This captcha shows some random numbers on an image, in different colors,
* the user has to enter the number of digits in a specific
*
* Copyright 2007 by Lucas van Dijk ([email protected])
* For more info see http://www.lucasvd.nl
*
* @package Captcha
* @category Captcha
* @license http://www.opensource.org/licenses/gpl-license.php
* @author Lucas van Dijk
*/

class Captcha
{
    protected $image;
    protected $image_size;
    protected $colors;
    protected $code;    

    public function __construct($size = 120)
    {

        if(session_id() == )
        {

            throw new Exception(The session has not yet been started, please use the function session_start() before calling this class.);
        }

        
        // Create a new GD resource
        $this -> image = imagecreatetruecolor($size, $size);
        $this -> image_size = $size;
        $this -> colors = array();
        
        // Fill the image with a white background
        $color = $this -> allocate_color(FFFFFF);
        imagefill($this -> image, 0, 0, $color);
    }

    
    private function __toString()
    {

        return $this -> code;
    }

    
    protected function allocate_color($color)
    {

        if(substr($color, 0, 1) == #)
        {

            $color = substr($color, 1);
        }

        
        if(array_key_exists($color, $this -> colors))
        {

            return $this -> colors[$color];
        }

        else
        {
            $parts = str_split($color, 2);
            eval($this -> colors[$color] = imagecolorallocate($this -> image, 0x.$parts[0]., 0x.$parts[1]., 0x.$parts[2].););
            return $this -> colors[$color];
        }
    }

    
    public function generate()
    {

        // Generate some lines, to divide the image in some smaller pieces
        $color = $this -> allocate_color(000000);
        $number_of_columns = mt_rand(3,5);
        $square_width = round($this -> image_size / $number_of_columns);
        
        for($i = 0; $i < $number_of_columns; $i++)
        {

            // Vertical line
            imageline($this -> image, 0, $i * $square_width, imagesx($this -> image), $i * $square_width, $color);
            
            // Horizontal Line
            imageline($this -> image, $i * $square_width, 0, $i * $square_width, imagesy($this -> image) - 1, $color);
        }

        
        imageline($this -> image, 0, imagesy($this -> image) - 1, imagesx($this -> image) - 1, imagesy($this -> image) - 1, $color);
        imageline($this -> image, imagesx($this -> image) - 1, 0, imagesx($this -> image) - 1, imagesy($this -> image) - 1, $color);
        
        // Add the numbers to the squares
        // Colors were going to use

        $colors = array();
        $colors[] = FF0000; // red
        $colors[] = 00FF00; // green
        $colors[] = 0000FF; // blue
        $colors[] = FF9900; // Orange
        
        $chars = array_merge(range(a, z), range(0, 9));
    
        $row = 0;
        $column = 0;
        while($row < $number_of_columns)
        {

            // Calculate X and Y
            $x = (($square_width / 2) - (imagefontwidth(2) / 2)) + ($column * $square_width);
            $y = (($square_width / 2) - (imagefontheight(2) / 2)) + ($row * $square_width);
            
            // Select a color were going to use
            $rand_color = mt_rand(0, count($colors) - 1);
            $color = $this -> allocate_color($colors[$rand_color]);
            
            $char = $chars[array_rand($chars)];
            if($colors[$rand_color] == 0000FF)
            {
              
                $this -> code .= $char;
            }

            
            imagestring($this -> image, 2, $x, $y, $char, $color);
            
            $column++;

            if($column == $number_of_columns)
            {

                $row++;
                $column = 0;
            }
        }
    }

    
    public function show()
    {

        imagepng($this -> image);
    }

    
    public function get_code()
    {

       return $this -> code;
    }
}

?>


# captcha.php (laat het plaatje zien)
<?php
session_start();
include includes/captcha.class.php;

$captcha = new Captcha();

$captcha -> generate();

$_SESSION[captcha_code] = strlen($captcha -> get_code()) == 0 ? - : $captcha -> get_code();

header("Content-Type: image/png");
$captcha -> show();

?>


# VOORBEELD:
# posten.php
<?php
session_start();

if(isset($_POST[submit]))
{

    if($_POST[captcha_code] != $_SESSION[captcha_code])
    {

        die("Verkeerde captcha code");
    }

    
    // Nu kan je de post in database zetten oid
}
else
{
    ?>

    <form method="post" action="posten.php">
        Naam: <input type="text"  name="name" />
        <br /><br />
        
        <b>Anti Bot test</b>
        <img src="captcha.php" alt="CAPTCHA" />
        <br />
        <input type="text" name="captcha_code" size="6" />
        <br />
        Op het plaatje zie je een aantal vakjes met letters er in, typ alleen de blauwe letters over in het tekst veld. Zie je geen blauwe letters, vul dan een streepje in (-).    
    </form>
    <?php
}
?>


Captcha (Tegen bots, leden/bezoekers moeten letters overtypen) van Phpfreaks.

Deel dit bericht


Link naar bericht
Delen op andere sites
Ja.
Codeblok:
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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
<?php
/**
 * Luckys Framework
 * A highly extendable MVC PHP framework
 *
 * Created by Lucas van Dijk (http://www.return1.net)
 * Copyright 2007 by Lucas van Dijk
 *
 * $Id$
 *
 * ---------------------------------------------------------------------
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
/**
 * Represents an image.
 *
 * @package Images
 * @author Lucas van Dijk
 */

class Image
{
    
    /**
     * Holds the image GD resource
     *
     * @var resource
     */

    protected $image_resource;
    
    /**
     * Holds the width of the image
     *
     * @var int
     */

    protected $width;
    
    /**
     * Holds the height of the image
     *
     * @var int
     */

    protected $height;
    
    /**
     * Constructor, creates the image resource
     * @param mixed $param1 The filename to open, or the width of the image
     * @param int $param2 The height of the image, when creating a new image (not from a file)
     */

    public function __construct($param1, $param2 = null)
    {

        if(empty($param2))
        {

            // Just one parameter given,
            // Param1 should be a filename

            $this -> image_resource = $this -> create_image($param1);
        }

        else
        {
            // Param 2 is given
            // So we create a new image with the width and height

            $this -> image_resource = imagecreatetruecolor(intval($param1), intval($param2));
        }

 
        if(!$this -> image_resource)
        {

            throw new Exception(Could not create image, 100);
        }

 
        $this -> update_size();
    }

 
    /**
     * Creates an GD image resource based on image type
     * @param string $file The file to open
     * @return resource
     */

    protected function create_image($file)
    {

        list(, , $image_type) = getimagesize($file);
        $img = false;
 
        switch($image_type)
        {
            case
3:
                $img = imagecreatefrompng($file);
            break;
            case
2:
                $img = imagecreatefromjpeg($file);
            break;
            case
1:
                $img = imagecreatefromgif($file);
            break;
            case
6:
                $img = imagecreatefromwbmp($file);
            break;
            default:

                throw new Exception(File is not a valid Image, 101);
        }

 
        return $img;
    }

    
    /**
     * Allocates a color, based on a hex color
     * @param string $color The hex color to allocate
     * @param int The background color
     */

    protected function allocate_color($color)
    {

        if(substr($color, 0, 1) == "#")
        {

            $color = substr($color, 1);
        }

        
        $parts = str_split($color, 2);
        
        return eval(return imagecolorallocate($this -> image_resource, 0x.$parts[0]., 0x.$parts[1]., 0x.$parts[2].););
    }

    
    /**
     * Generates a random hex color
     * @param bool $return_array return an array with three elememts containing each a part of the color, default false
     * @return string|array The random hex color
     */

    protected function random_hex_color($return_array = false)
    {

        $chars = array_merge(range(A, F), range(0, 9 ));
 
        $max_chars = count($chars) - 1;
        srand( (double) microtime()*1000000);
 
        $rand_color = #;
        for($i = 0; $i < 6; $i++)
        {

            $rand_color = ( empty($rand_color)) ? $chars[rand(0, $max_chars)] : $rand_color . $chars[rand(0, $max_chars)];
        }

 
        if($return_array)
        {

            $rand_color_array = array();
            $rand_color_array[0] = substr($rand_color, 1, 2);
            $rand_color_array[1] = substr($rand_color, 3, 2);
            $rand_color_array[2] = substr($rand_color, 5, 2);
 
            return $rand_color_array;
        }

 
        return $rand_color;
    }

    
    /**
     * Generates a random RGB Color
     * @return array with key 0 as red, key 1 as green, and key 2 as blue
     */

    protected function random_rgb_color()
    {

        $color = array();
        for ($c = 0; $c < 3; $c++)
        {

            $color[] = rand(1, 255);
        }

 
        return $color;
    }

    
    /**
     * Updates the width and height of the image
     */

    protected function update_size()
    {

        $this -> width = imagesx($this -> image_resource);
        $this -> height = imagesy($this -> image_resource);
    }

    
    /**
     * Returns the image resource
     * @return resource
     */

    public function get_resource()
    {

        return $this -> image_resource;
    }

    
    /**
     * Copies an Image object into the current image
     * @param Image $image the image object to copy
     * @param int $x The X position
     * @param int $y The Y psoition
     */

    public function copy(Image $image, $x, $y)
    {

        imagecopy($this -> image_resource, $image -> get_resource(), $x, $y, 0, 0, $image -> get_width() - 1, $image -> get_height() - 1);
    }

    
    /**
     * Resizes the image
     * @param int $max_width max width of the image
     * @param int $max_height max height of the image
     * @param bool $keep_aspect_ratio True if you wnat to keep the aspect ratio
     */

    public function resize($max_width, $max_height, $keep_aspect_ratio = true)
    {
      
        if($keep_aspect_ratio)
        {

            // Find resize scale
            $resize_scale = min(min($max_width / $this -> width, $max_height / $this -> height), 1.0);
    
            $new_width = $resize_scale * $this -> width;
            $new_height = $resize_scale * $this -> height;
        }

        else
        {
            $new_width = $max_width;
            $new_height = $max_height;
        }

 
        $new_img = imagecreatetruecolor($new_width, $new_height);
 
        // Resize it
        imagecopyresampled($new_img, $this -> image_resource, 0, 0, 0, 0, $new_width, $new_height, $this -> width, $this -> height);
        
        $this -> image_resource = $new_img;
        $this -> update_size();
    }

    
    
    /**
     * Outputs the image to the screen
     *
     * This method outputs the current image to the screen.
     * Note: This function does <b>not</b> send the right Content-Type
     * for the image, youll have to do that by yourself
     * @param string $type The image type to output
     * @param int $quality The quality of the image (only needed for JPEG images)
     */

    public function show_image($type = "png", $quality = 70)
    {

        switch($type)
        {
            case
"png":
                imagepng($this -> image_resource);
            break;
            case
"jpg":
            case
"jpeg":
                imagejpeg($this -> image_resource, null, $quality);
            break;
            case
"gif":
                imagegif($this -> image_resource);
            break;
            default:

                imagepng($this -> image_resource);
        }
    }

 
    /**
     * Saves the image to a specific path
     * @param string $file The path where to save to
     * @param string $type The image type
     * @param int $quality The quality of the image (only needed for JPEG images)
     */

    public function save_to_file($file, $type = "png", $quality = 70)
    {

        switch($type)
        {
            case
"png":
                imagepng($this -> image_resource, $file);
            break;
            case
"jpg":
            case
"jpeg":
                imagejpeg($this -> image_resource, $file, $quality);
            break;
            case
"gif":
                imagegif($this -> image_resource, $file);
            break;
            default:

                imagepng($this -> image_resource, $file);
        }
    }

    
    /**
     * Returns the width of the image
     *
     * @return int
     */

    public function get_width()
    {

        return $this -> width;
    }

    
    /**
     * Returns the height of the image
     *
     * @return int
     */

    public function get_height()
    {

        return $this -> height;
    }

    
    public function __toString()
    {

        return imagepng($this -> image_resource);
    }
}

 
/**
 * Represents the captcha image
 * It generates a number of drawings,
 * paints it on the main image,
 * and sets the captcha code
 * @package Images
 * @author Lucas van Dijk
 */

class Captcha extends Image
{
    protected $drawings = array();
    protected $font;
    protected $number;
    protected $code_length;
    protected $code;
    
    /**
     * Constructor, sets the captcha parameters, and inits the image
     * @param string $font The TTF font file used in the image, use ./font.ttf (with ./) ti use a font in the current directory
     * @param int $number_of_drawings The number of drawings you want to generate
     * @param int $code_length The length of the catcha codes
     */

    public function __construct($number_of_drawings = 2, $code_length = 5)
    {

        if(!(ctype_digit((string) $number_of_drawings) && ctype_digit((string) $code_length)))
        {

            throw new InvalidArgumentException(Invalid parameters);
        }
      
        
        $this -> code_length = $code_length;
        $this -> number = $number_of_drawings;
        
        $height = 50 + ($number_of_drawings * 35);      
        $width = 200 + (imagefontwidth(4) * $code_length) + 50;
        
        parent::__construct($width, $height);
        $this -> create();
        imagecolortransparent($this -> image_resource, $this -> allocate_color(FFFFFF));
    }

    
    /**
     * Generates a random string
     * @param int $max_length The length of the generated string
     * @param bool $hash Hash the string with md5?
     * @return string The generated string
     */

    public function generate_random_string($max_length = 8, $hash = false)
    {

        $chars = array_merge(range(a, z), range(A, Z), range(0, 9));
 
        $max_chars = count($chars) - 1;
 
        $rand_str = ;
        for($i = 0; $i < $max_length; $i++)
        {

            $rand_str = ($i == 0) ? $chars[mt_rand(0, $max_chars)] : $rand_str . $chars[mt_rand(0, $max_chars)];
        }

 
        return ($hash) ? md5($rand_str) : $rand_str;
    }

    
    /**
     * Returns the main captcha code
     * @return string
     */

    public function get_code()
    {

        return $this -> code;
    }

    
    /**
     * Creates the image
     *
     * Adds a border to the image, the seperation line, and paints the drawings
     * on the image
     */

    protected function create()
    {

        imagefilledrectangle($this -> image_resource, 0, 0, $this -> get_width() - 1, $this -> get_height() - 1, $this -> allocate_color(FFFFFF));
        imagerectangle($this -> image_resource, 0, 0, $this -> get_width() - 1, $this -> get_height() - 1, $this -> allocate_color(000000));
        imageline($this -> image_resource, 150, 0, 150, $this -> get_height(), $this -> allocate_color(000000));
        
        for($i = 0; $i < $this -> number; $i++)
        {

            $this -> add_drawing(new CaptchaDrawing());
        }

        
        // Determine the main drawing
        $main = mt_rand(0, count($this -> drawings) - 1);
        $this -> code = $this -> drawings[$main][1];
        $this -> paint_drawings($main);
    }

    
    /**
     * This function paints the drawings on the main image
     * @param int $main The index of the main image, which will be painted on the left
     */

    protected function paint_drawings($main)
    {

        // paint the main drawing on the image
        $this -> copy($this -> drawings[$main][0], 25, ($this -> get_height() / 2) - 50);
        
        // Paint all drawings on the right of the image, with the code
        $i = 0;
        $x = 175;
        foreach($this -> drawings as $drawing)
        {

            $drawing[0] -> resize(30, 30);
            $this -> copy($drawing[0], $x, 25 + (50 * $i) - 15);
            
            imagestring($this -> image_resource, 4, $x + 40, 15 + (50 * $i), $drawing[1], $this -> allocate_color(000000));
            $i++;
        }
    }
          
    
    /**
     * Adds a drawing to the $drawings member, and generates a code for the drawing
     * @param CaptchaDrawing $drawing The drawing to add
     */

    protected function add_drawing(CaptchaDrawing $drawing)
    {

        $this -> drawings[] = array($drawing, $this -> generate_random_string($this -> code_length));
    }
}

 
/**
 * A simple drawing on the captcha images
 *
 * The drawing is generated completely random
 * @package Images
 * @author Lucas van Dijk
 */

class CaptchaDrawing extends Image
{
    /**
     * Constructor, generates the image immediatly
     * @param int $width The width of the drawing
     * @param int $height The height of the drawing
     */

    public function __construct($width = 100, $height = 100)
    {

        parent::__construct($width, $height);
        $this -> generate_random_drawing();
    }

    
    /**
     * Generates a completely random drawing
     */

    protected function generate_random_drawing()
    {
      
        imagefilledrectangle($this -> image_resource, 0, 0, $this -> get_width() - 1, $this -> get_height() - 1, $this -> allocate_color(FFFFFF));
        
        $lines_drawed = 0;
        $max_lines = rand(2, 5);
        
        $min_width = $this -> get_width() / 100 * 15;
        $max_width = $this -> get_width() / 100 * 75;
        $min_height = $this -> get_height() / 100 * 15;
        $max_height = $this -> get_height() / 100 * 75;
        
        $rectangle_drawed = false;
        $circle_drawed = false;
        
        while(($rectangle_drawed == false || $circle_drawed == false) && $lines_drawed < $max_lines)
        {

            $what_to_draw = mt_rand(1, 4);
            
            // generate random width/height
            $width = mt_rand($min_width, $max_width);
            $height = $width * (mt_rand(75, 120) / 100);
            
            // Generate the X and Y positions
            $max_x = $this -> get_width() - $width;
            $max_y = $this -> get_height() - $height;
            
            $x = mt_rand(0, $max_x);
            $y = mt_rand(0, $max_y);
            
            $filled = mt_rand(0, 2) != 0;
            
            switch($what_to_draw)
            {
                case
1:        
                    if($filled)
                    {

                        imagefilledellipse($this -> image_resource, $x, $y, $width, $height, $this -> allocate_color($this -> random_hex_color()));
                    }

                    else
                    {
                        imageellipse($this -> image_resource, $x, $y, $width, $height, $this -> allocate_color($this -> random_hex_color()));
                    }

                    
                    $circle_drawed = true;
                break;
                case
2:        
                    if($filled)
                    {

                        imagefilledrectangle($this -> image_resource, $x, $y, $x + $width, $y + $height, $this -> allocate_color($this -> random_hex_color()));
                    }

                    else
                    {
                        imagerectangle($this -> image_resource, $x, $y, $x + $width, $y + $height, $this -> allocate_color($this -> random_hex_color()));
                    }

                    
                    $rectangle_drawed = true;
                break;
                case
3:
                case
4:        
                    // Draw a random line
                    if($lines_drawed <= $max_lines)
                    {

                        $x2 = mt_rand($min_width, $max_width);
                        $y2 = mt_rand($min_height, $max_height);
                        
                        imageline($this -> image_resource, $x, $y, $x2, $y2, $this -> allocate_color($this -> random_hex_color()));
                        $lines_drawed++;
                    }

                break;
            }
        }
    }
}

captcha.php
Codeblok:
1
2
3
4
5
6
7
8
9
<?php
session_start();
include_once captcha.class.php;
 
$captcha = new Captcha(3);
$_SESSION[captcha_code] = strtolower($captcha -> get_code());
 
header("Content-Type: image/png");
echo (string) $captcha;

Deel dit bericht


Link naar bericht
Delen op andere sites

Maak een account aan of log in om te reageren

Je moet lid zijn om een reactie te kunnen achterlaten

Account aanmaken

Maak een account aan in onze gemeenschap. Het is makkelijk!

Registreer een nieuw account

Aanmelden

Ben je al lid? Meld je hier aan.

Nu aanmelden
Log in om dit te volgen  

×