|
Posted by -Lost on 06/06/07 04:16
Jon Slaughter wrote:
> "-Lost" <maventheextrawords@techie.com> wrote in message
> news:5qSdnYpGbrhdsvvbnZ2dnUVZ_qWvnZ2d@comcast.com...
>> Jon Slaughter wrote:
>>> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
>>> news:DqmdnblDqsDAlPvbnZ2dnUVZ_u_inZ2d@comcast.com...
>>>> Jon Slaughter wrote:
>>>>> is it possible to do image manipulation with php that isn't low level?
>>>>>
>>>>> I basically want to create some captchas manually (given a text string)
>>>>> but I not sure if its possible to do. I want to ultimately do it in
>>>>> real time if possible.
>>>>>
>>>>> The idea is to turn the text into an image and then apply some image
>>>>> processing(transformations that make it more random such as adding fuzz
>>>>> or changing colors, etc..) to make it harder to hack.
>>>>>
>>>>> How do websites normally go about creating them? Manually or offline?
>>>>>
>>>>> Thanks,
>>>>> Jon
>>>> Just google for CAPTCHA and PHP. There are several examples out there
>>>> already - and all do it real time. It's really not that bad.
>>>>
>>> lol... I guess I should have done that first... looks quite easy.
>>> Although I'm looking to do something original with the captchas that will
>>> require more cycles... but atleast I have somewhere to start.
>> With GD:
>>
>> <?php
>> header('Content-Type: ' . image_type_to_mime_type(IMAGETYPE_JPEG)) . ';';
>> header('Content-Disposition: filename="' . $_SERVER['REMOTE_ADDR'] .
>> '";');
>> $img = imagecreate(275,25);
>> $bg = imagecolorallocate($img, 102, 102, 153);
>> $fg = imagecolorallocate($img, 255, 255, 255);
>> imagefill($img, 0, 0, $bg);
>> $msg = " Your IP is {$_SERVER['REMOTE_ADDR']}";
>> imagestring($img, 10, 5, 5, $msg, $fg);
>> imagejpeg($img);
>> imagedestroy($img);
>> ?>
>>
>> Of course you would create a random CAPTCHA or whatever floats your boat.
>>
>
> Yeah, I found some code but spent the last 2 hours trying to get gd to work
> in zend ;/
>
> seems adding the dll and library stuff just doens't work ;/ Works under
> apache and php5 but not under the local php5 that zend uses ;/ really sucks
> as it makes debugging difficult and can't seem to find the reason for it so
> I guess I have to use the server to debug it ;/
>
> (I downloaded the latest GD stuff with the php_gd2.dll and added the
> extensions tag in the php.ini in zend but no luck ;/ can't even seem to find
> the error reporting... but just can't get it to show up in phpinfo())
Damn. Wish I could help mate, but I have never used Zend.
I wouldn't have the slightest idea where to start.
--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Navigation:
[Reply to this message]
|