Re: image validation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi,giving error only in my localhost,

error is:

 Fatal error: Call to undefined function ImageCreate() in 
G:\wamp\www\components\form_image_val\working\HCIC\Cap_Img.php on line 
13









   HARAN

--- On Wed, 8/10/08, kranthi <kranthi117@xxxxxxxxx> wrote:
From: kranthi <kranthi117@xxxxxxxxx>
Subject: Re:  image validation
To: php-objects@xxxxxxxxxxxxxxx
Date: Wednesday, 8 October, 2008, 1:04 PM

you code seems to be error free

http://pear.php.net/package/Text_CAPTCHA
hope this provides a better solution to your problem..

and note that you will have to use <img
src="*full/path/of/the/phpfile*">

can u post the error statement appearing on your browser..

Kranthi.


On Wed, Oct 8, 2008 at 17:15, tap haran <tapharan@xxxxxxxxx> wrote:

>   hi,i need image validation 4 form submit,
> but,image is not creating,it give no image
>
> code
> <?php
> header("Content-type: image/png");
> $im = @imagecreatetruecolor(110, 20)
>     or die("Cannot Initialize new GD image stream");
> $background_color = imagecolorallocate($im, 0, 0, 0);
> $text_color = imagecolorallocate($im, 233, 14, 91);
> imagestring($im, 1, 5, 5,  "A Simple Text String", $text_color);
> imagepng($im);
> imagedestroy($im);
> ?>
> //----------------------------------------------------------
> or this
>
> <?php
>     session_start();
>     $md5_hash = md5(rand(0,9999));
>     $security_code = substr($md5_hash, 25, 5);
>     $enc=md5($security_code);
>     $_SESSION['count'] = $enc;
>     $secure = $_SESSION['count'];
>     //     echo "--------------------------$secure<br>";
>
>     $width = 100;
>     $height = 40;
>
>     $image = ImageCreate($width, $height);
>     $white = ImageColorAllocate($image, 255, 255, 255);
>     $black = ImageColorAllocate($image, 0, 100, 0);
>     $grey = ImageColorAllocate($image, 204, 204, 204);
>
>     ImageFill($image, 0, 0, $grey);
>     //Add randomly generated string in white to the image
>     ImageString($image, 10, 30, 10, $security_code, $black);
>     ImageRectangle($image,0,16,$width-1,$height-1,$grey);
>     imageline($image, 0, $height/2, $width, $height/2, $grey);
>     imageline($image, $width/2, 0, $width/2, $height, $grey);
>
>     header("Content-Type: image/jpeg");
>     ImageJpeg($image);
>     ImageDestroy($image);
>     ImageDestroy($image);
>     ?>
>
> Get your preferred Email name!
> Now you can @ymail.com and @rocketmail.com.
> http://mail.promotions.yahoo.com/newdomains/aa/
>
> [Non-text portions of this message have been removed]
>
>  
>


[Non-text portions of this message have been removed]


------------------------------------

Are you looking for a PHP job? Join the PHP Professionals directory Now!
http://www.phpclasses.org/professionals/Yahoo! Groups Links






      New Email addresses available on Yahoo!
Get the Email name you&#39;ve always wanted on the new @ymail and @rocketmail. 
Hurry before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/

[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux