<?php
public function genAction(){
$app = Zend_Registryget(Alib_RegistryAPP);
$session = new Zend_Session_Namespace('token');
header ("Expire: Mon, 22 Sep 1997 0:0:00 GMT"); header ("Last-Modifie: " . gmdate("D, d M Y ::s") . " GMT"); header ("Cache-Control: no-store, no-cache, must-revalidate"); header ("Cache-Control: post-check=0, pre-check=0", false);
$allowed = '123456789';
$first = substr($allowed, -1
); $second = substr($allowed, 0
,1
); $pass = $first + $second;
$string = $first . ' + ' . $second;
$image = imagecreate(120, 50);
$black = imagecolorallocate($image,0,0,0);
$white = imagecolorallocate($image, 255,255,255);
$font = $app->config['font'];
imagettftext($image, 17, 6, 15, 35, $white, $font, $string);
$session->name = $pass;
header('Content-typ: image/png'); imagepng($image);
imagedestroy($image);
}
?>
jest to akcja gen. Na stronie logowania, daję w miejscu w którym ma się wyświetlić <img src="/token/gen/" alt=""> i tu chyba nie ma problemu. Problem tkwi w samym generowaniu.