You are here: Re: Cannot generate random image for form security - help « PHP Programming Language « IT news, forums, messages
Re: Cannot generate random image for form security - help

Posted by comp.lang.php on 04/04/06 17:39

See below, thanx

Oli Filth wrote:
> comp.lang.php said the following on 03/04/2006 23:00:
> <...SNIP CODE...>
> >
> > This class method is supposed to generate one of those random images
> > you see on forms, you know, with the letters and numbers all mixed up
> > for people to type it in for security and repost protection purposes.
> >
> > This method, however, fails. No errors, no warnings, no notices, not
> > even a broken image, it just DIES on the spot, completely, stops dead
> > on the line:
> >
> > [PHP]
> > if (!$image && strcmp($type, 'gif') != 0) $image =
> > imagecreatetruecolor(150, 30); else $im = imagecreate(100, 50) or
> > die("Cannot Initialize new GD image stream");
> > [/PHP]
> >
>
> I'm not going to attempt to debug your code, but firstly, do you
> definitely have error reporting level set to E_ALL? Secondly, you're
> using eval() on the line before this, so there's a good chance that this
> could cock things up. Incidentally, why are you using eval() at all?
>

I debug by setting error_reporting() to E_ALL, however, that does not
show anything, not even notices that could be spawned.

Secondly, the reason I'm using eval() is very simple: I will be
generating a random image that could be a PNG, a GIF, a JPEG, a TIFF, a
BMP, etc., depending on the immediate need, thus, one command like
imagepng() or imagejpeg() is insufficient.

Phil


> --
> Oli

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация