Project

General

Profile

« Previous | Next » 

Revision 287

Added by stefan over 18 years ago

Fixed ticket #107 - captcha being cached.

View differences:

captcha.php
59 59
		imagestring($image, $fnt, $x, $y, substr($_SESSION['captcha'], $i, 1), $darkgray); 
60 60
	}
61 61
	
62
	header('Content-type: image/png');
62
	// start buffering for size determination
63
	ob_start();
64
	// add no cache headers
65
	header("Expires: Mon, 1 Jan 1990 05:00:00 GMT");
66
	header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
67
	header("Cache-Control: no-store, no-cache, must-revalidate");
68
	header("Cache-Control: post-check=0, pre-check=0", false);
69
	header("Pragma: no-cache");
70
	header("Content-type: image/png");
71
	// Make image
63 72
	imagepng($image);
73
	// Fetch length
74
	header("Content-Length: " . ob_get_length());
75
	// send image and turn off buffering
76
	ob_end_flush();
77
	// clear memory
64 78
	imagedestroy($image);
65
	
79

  
66 80
}
67 81

  
68 82
?>

Also available in: Unified diff