первая строчка - это создание объекта класса Text_CAPTCHA;
вторая строчка - вызов метода factory созданного объекта, в данном случае возвращает объект класса Image_Text вроде бы.
я поковырялся немного внутри классов, где возникали ошибки. кое-что исправил.
теперь капча работает. пока вроде бы без багов.
также пришлось изменить кое-что в файле PEAR.php, а именно добавить static к функции isError.
и тут мне не понятно, почему разработчики pear сами этого не сделали???
Strict Standards: Non-static method Text_Password::create() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Text\CAPTCHA\Driver\Image.php on line 169
Strict Standards: Non-static method Text_Password::_createPronounceable() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Text\Password.php on line 63
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Text\CAPTCHA\Driver\Image.php on line 217
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Image\Text.php on line 479
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Image\Text.php on line 675
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Image\Text.php on line 929
Если раскоментировать строчку header('Content-type: image/png'); то браузер пишет:
Цитата:
Изображение «http://phpweb20/c.php» не может быть показано, так как содержит ошибки.
С закоментированной строчкой браузер выдает такое:
Цитата:
Strict Standards: Non-static method Text_CAPTCHA::factory() should not be called statically in C:\www\phpweb20\htdocs\c.php on line 8
Strict Standards: Non-static method Text_Password::create() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Text\CAPTCHA\Driver\Image.php on line 169
Strict Standards: Non-static method Text_Password::_createPronounceable() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Text\Password.php on line 63
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Text\CAPTCHA\Driver\Image.php on line 217
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Image\Text.php on line 479
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Image\Text.php on line 675
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Image\Text.php on line 929
Эти кракозябры, насколько я понимаю, сгенерированое изображение, при обновлении меняются. Но почему браузер не может отобразить его как картинку?
И почему возникают эти ошибки, если вызов функций согласно документации к модулю.