Witam, mam mały problem ze zrozumieniem dodawnia w kod JFactory::getSession();. Rozszerzam funkcjonowanie komponentu gmapsinfo. Polega to na dodaniu sprawdzania captcha przed wystawieniem komentarza. Obraz captcha jest generowany przez plik image.php:
Kod PHP:
$session JFactory::getSession();
header ("(anti-spam-content-type:) image/jpg");
$enc_num rand(09999); 
$key_num rand(024);
$hash_string substr(md5($enc_num), $key_num5);
$hash_md5 md5($hash_string);
$session->set('captcha'$hash_md5);
$bgs = array("imag/back1.jpg""imag/back2.jpg""imag/back3.jpg");
$background array_rand($bgs1);
$img_handle imagecreatefromjpeg($bgs[$background]);
$text_colour imagecolorallocate($img_handle000);
$font_size 5;
$size_array getimagesize($bgs[$background]);
$img_w $size_array[0];
$img_h $size_array[1];
$horiz round(($img_w/2)-((strlen($hash_string)*imagefontwidth(5))/2), 1);
$vert round(($img_h/2)-(imagefontheight($font_size)/2));
imagestring($img_handle$font_size$horiz$vert$hash_string$text_colour);
imagejpeg($img_handle);
imagedestroy($img_handle); 
zaś wywołany jest w formularzu przez:
Kod PHP:
<img src="image/image.php" border="0"
I teraz pytanie, co mam zrobić z plikiem image.php aby wiedział co to są za zmienne:
$session = JFactory::getSession();
$session->set('captcha', $hash_md5);
Próbowałem zrobić z tego moduł, ale niestety nieskutecznie:/