/** * @see Page::show() */ public function show() { parent::show(); if ($this->action == 'newCaptchaID') { // get new captcha id $captchaID = Captcha::create(); // send header header('Content-type: text/xml'); HeaderUtil::sendNoCacheHeaders(); // print xml echo "<?xml version=\"1.0\" encoding=\"" . CHARSET . "\"?>\n<captchaid>" . $captchaID . "</captchaid>"; exit; } else { // send header header("Content-type: image/png"); // show image $image = new CaptchaImage($this->captcha->captchaString); } }