PHP Problem

T

Teriel9

I am trying to test my server fpr PHP function for use in a CAPTCHA and I
get this message if I open the CAPTCHA generating page

<br />
<b>Fatal error</b>: Call to undefined function: imagecreate() in
<b>c:\home\rnacarms\html\testcaptcha\captcha.php</b> on line <b>6</b><br
/>This is the code on the captcha.php page<?phpsession_start();
header("Content-type: image/png");

$image = imagecreate(60,20);

$background_color = ImageColorAllocate($image, rand(64,70), rand(70,73),
rand(100,110));

$colour1 = ImageColorAllocate($image, rand(121,255), rand(126,255),
rand(197,255));
$colour2 = ImageColorAllocate($image, rand(100,255), rand(120,255),
rand(105,255));
$colour3 = ImageColorAllocate($image, rand(131,255), rand(137,255),
rand(100,255));


imagestring($image,5,8,2,$_SESSION["captcha"],$colour1);
imagestring($image,5,8,2,$_SESSION["captcha"],$colour2);
imagestring($image,5,8,2,$_SESSION["captcha"],$colour3);


imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour1);
imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour2);
imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour3);


imageline($image, 10, 0, 14, 10, $colour1);
imageline($image, 20, 0, 24, 30, $colour2);
imageline($image, 55, 0, 34, 60, $colour3);


imagepng($image);

imagedestroy($image);
?>
Can anyone please explain the problem.
It can be seen online at
http://www.rna-carmarthen.org.uk/testcaptcha/start.html
http://www.rna-carmarthen.org.uk/testcaptcha/captcha.php
Thanks in advance
Teriel9
 
T

Thomas A. Rowe

Just ask your web host what is supported.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 
T

Teriel9

Hi Tom,
I assumed that since the other PHP pages rendered OK that they do support
..php. and that perhaps there was an error on this page.
I have already sent an email asking if they do support .php and am awaiting
a reply.
I'll advise you if they say yes.
Thank you for your prompt response
Teriel9

Thomas A. Rowe said:
Just ask your web host what is supported.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================


Teriel9 said:
I am trying to test my server fpr PHP function for use in a CAPTCHA and I
get this message if I open the CAPTCHA generating page

<br />
<b>Fatal error</b>: Call to undefined function: imagecreate() in
<b>c:\home\rnacarms\html\testcaptcha\captcha.php</b> on line <b>6</b><br
/>This is the code on the captcha.php page<?phpsession_start();
header("Content-type: image/png");

$image = imagecreate(60,20);

$background_color = ImageColorAllocate($image, rand(64,70), rand(70,73),
rand(100,110));

$colour1 = ImageColorAllocate($image, rand(121,255), rand(126,255),
rand(197,255));
$colour2 = ImageColorAllocate($image, rand(100,255), rand(120,255),
rand(105,255));
$colour3 = ImageColorAllocate($image, rand(131,255), rand(137,255),
rand(100,255));


imagestring($image,5,8,2,$_SESSION["captcha"],$colour1);
imagestring($image,5,8,2,$_SESSION["captcha"],$colour2);
imagestring($image,5,8,2,$_SESSION["captcha"],$colour3);


imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour1);
imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour2);
imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour3);


imageline($image, 10, 0, 14, 10, $colour1);
imageline($image, 20, 0, 24, 30, $colour2);
imageline($image, 55, 0, 34, 60, $colour3);


imagepng($image);

imagedestroy($image);
?>
Can anyone please explain the problem.
It can be seen online at
http://www.rna-carmarthen.org.uk/testcaptcha/start.html
http://www.rna-carmarthen.org.uk/testcaptcha/captcha.php
Thanks in advance
Teriel9
 
T

Thomas A. Rowe

Your pages seem to be working with the exception of the image being displayed. If the image is being
created on the fly, then special permissions made need to be set by your web host to allow the
script to function correctly.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================


Teriel9 said:
Hi Tom,
I assumed that since the other PHP pages rendered OK that they do support .php. and that perhaps
there was an error on this page.
I have already sent an email asking if they do support .php and am awaiting a reply.
I'll advise you if they say yes.
Thank you for your prompt response
Teriel9

Thomas A. Rowe said:
Just ask your web host what is supported.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================


Teriel9 said:
I am trying to test my server fpr PHP function for use in a CAPTCHA and I get this message if I
open the CAPTCHA generating page

<br />
<b>Fatal error</b>: Call to undefined function: imagecreate() in
<b>c:\home\rnacarms\html\testcaptcha\captcha.php</b> on line <b>6</b><br />This is the code on
the captcha.php page<?phpsession_start();
header("Content-type: image/png");

$image = imagecreate(60,20);

$background_color = ImageColorAllocate($image, rand(64,70), rand(70,73), rand(100,110));

$colour1 = ImageColorAllocate($image, rand(121,255), rand(126,255), rand(197,255));
$colour2 = ImageColorAllocate($image, rand(100,255), rand(120,255), rand(105,255));
$colour3 = ImageColorAllocate($image, rand(131,255), rand(137,255), rand(100,255));


imagestring($image,5,8,2,$_SESSION["captcha"],$colour1);
imagestring($image,5,8,2,$_SESSION["captcha"],$colour2);
imagestring($image,5,8,2,$_SESSION["captcha"],$colour3);


imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150), $colour1);
imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150), $colour2);
imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150), $colour3);


imageline($image, 10, 0, 14, 10, $colour1);
imageline($image, 20, 0, 24, 30, $colour2);
imageline($image, 55, 0, 34, 60, $colour3);


imagepng($image);

imagedestroy($image);
?>
Can anyone please explain the problem.
It can be seen online at
http://www.rna-carmarthen.org.uk/testcaptcha/start.html
http://www.rna-carmarthen.org.uk/testcaptcha/captcha.php
Thanks in advance
Teriel9
 
T

Teriel9

Thank you both for your kind assistance, have advised ISP accordingly
Teriel9

SingaporeWebDesign said:
Hello,

That error is caused because gdi library module is not enabled in PHP. You
will need to contact your hosting company to enable them.

http://sg2.php.net/gd

--
Singapore Website Design
http://www.bootstrike.com/Webdesign/
Singapore Web Hosting
http://www.bootstrike.com/WinXP/faq.html
Windows XP FAQ

Teriel9 said:
I am trying to test my server fpr PHP function for use in a CAPTCHA and I
get this message if I open the CAPTCHA generating page

<br />
<b>Fatal error</b>: Call to undefined function: imagecreate() in
<b>c:\home\rnacarms\html\testcaptcha\captcha.php</b> on line <b>6</b><br
/>This is the code on the captcha.php page<?phpsession_start();
header("Content-type: image/png");

$image = imagecreate(60,20);

$background_color = ImageColorAllocate($image, rand(64,70), rand(70,73),
rand(100,110));

$colour1 = ImageColorAllocate($image, rand(121,255), rand(126,255),
rand(197,255));
$colour2 = ImageColorAllocate($image, rand(100,255), rand(120,255),
rand(105,255));
$colour3 = ImageColorAllocate($image, rand(131,255), rand(137,255),
rand(100,255));


imagestring($image,5,8,2,$_SESSION["captcha"],$colour1);
imagestring($image,5,8,2,$_SESSION["captcha"],$colour2);
imagestring($image,5,8,2,$_SESSION["captcha"],$colour3);


imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour1);
imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour2);
imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour3);


imageline($image, 10, 0, 14, 10, $colour1);
imageline($image, 20, 0, 24, 30, $colour2);
imageline($image, 55, 0, 34, 60, $colour3);


imagepng($image);

imagedestroy($image);
?>
Can anyone please explain the problem.
It can be seen online at
http://www.rna-carmarthen.org.uk/testcaptcha/start.html
http://www.rna-carmarthen.org.uk/testcaptcha/captcha.php
Thanks in advance
Teriel9
 
T

Teriel9

Hi,
My ISP has asked if this GDI module requires a specific version of PHP, can
you help please.
They are using a Windows server
They have also offered to transfer to a UNIX server, which they say suits
..php better, my only worry is whether my "Contentseed" application will
still function OK.
Thanks in advance
Teriel9


--
All our emails are scanned by Norton Antivirus before sending
Please advise any virus that gets through
SingaporeWebDesign said:
Hello,

That error is caused because gdi library module is not enabled in PHP. You
will need to contact your hosting company to enable them.

http://sg2.php.net/gd

--
Singapore Website Design
http://www.bootstrike.com/Webdesign/
Singapore Web Hosting
http://www.bootstrike.com/WinXP/faq.html
Windows XP FAQ

Teriel9 said:
I am trying to test my server fpr PHP function for use in a CAPTCHA and I
get this message if I open the CAPTCHA generating page

<br />
<b>Fatal error</b>: Call to undefined function: imagecreate() in
<b>c:\home\rnacarms\html\testcaptcha\captcha.php</b> on line <b>6</b><br
/>This is the code on the captcha.php page<?phpsession_start();
header("Content-type: image/png");

$image = imagecreate(60,20);

$background_color = ImageColorAllocate($image, rand(64,70), rand(70,73),
rand(100,110));

$colour1 = ImageColorAllocate($image, rand(121,255), rand(126,255),
rand(197,255));
$colour2 = ImageColorAllocate($image, rand(100,255), rand(120,255),
rand(105,255));
$colour3 = ImageColorAllocate($image, rand(131,255), rand(137,255),
rand(100,255));


imagestring($image,5,8,2,$_SESSION["captcha"],$colour1);
imagestring($image,5,8,2,$_SESSION["captcha"],$colour2);
imagestring($image,5,8,2,$_SESSION["captcha"],$colour3);


imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour1);
imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour2);
imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour3);


imageline($image, 10, 0, 14, 10, $colour1);
imageline($image, 20, 0, 24, 30, $colour2);
imageline($image, 55, 0, 34, 60, $colour3);


imagepng($image);

imagedestroy($image);
?>
Can anyone please explain the problem.
It can be seen online at
http://www.rna-carmarthen.org.uk/testcaptcha/start.html
http://www.rna-carmarthen.org.uk/testcaptcha/captcha.php
Thanks in advance
Teriel9
 
S

SingaporeWebDesign

Hello,

From the link I specified
"Since PHP 4.3 there is a bundled version of the GD lib. This bundled
version has some additional features like alpha blending, and should be used
in preference to the external library since its codebase is better
maintained and more stable. "

For installation in windows, from the link I specified:
"In Windows, you'll include the GD2 DLL php_gd2.dll as an extension in
php.ini. "

--
Singapore Website Design
http://www.bootstrike.com/Webdesign/
Singapore Web Hosting
http://www.bootstrike.com/WinXP/faq.html
Windows XP FAQ

Teriel9 said:
Hi,
My ISP has asked if this GDI module requires a specific version of PHP,
can you help please.
They are using a Windows server
They have also offered to transfer to a UNIX server, which they say suits
.php better, my only worry is whether my "Contentseed" application will
still function OK.
Thanks in advance
Teriel9


--
All our emails are scanned by Norton Antivirus before sending
Please advise any virus that gets through
SingaporeWebDesign said:
Hello,

That error is caused because gdi library module is not enabled in PHP.
You will need to contact your hosting company to enable them.

http://sg2.php.net/gd

--
Singapore Website Design
http://www.bootstrike.com/Webdesign/
Singapore Web Hosting
http://www.bootstrike.com/WinXP/faq.html
Windows XP FAQ

Teriel9 said:
I am trying to test my server fpr PHP function for use in a CAPTCHA and I
get this message if I open the CAPTCHA generating page

<br />
<b>Fatal error</b>: Call to undefined function: imagecreate() in
<b>c:\home\rnacarms\html\testcaptcha\captcha.php</b> on line <b>6</b><br
/>This is the code on the captcha.php page<?phpsession_start();
header("Content-type: image/png");

$image = imagecreate(60,20);

$background_color = ImageColorAllocate($image, rand(64,70), rand(70,73),
rand(100,110));

$colour1 = ImageColorAllocate($image, rand(121,255), rand(126,255),
rand(197,255));
$colour2 = ImageColorAllocate($image, rand(100,255), rand(120,255),
rand(105,255));
$colour3 = ImageColorAllocate($image, rand(131,255), rand(137,255),
rand(100,255));


imagestring($image,5,8,2,$_SESSION["captcha"],$colour1);
imagestring($image,5,8,2,$_SESSION["captcha"],$colour2);
imagestring($image,5,8,2,$_SESSION["captcha"],$colour3);


imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour1);
imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour2);
imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour3);


imageline($image, 10, 0, 14, 10, $colour1);
imageline($image, 20, 0, 24, 30, $colour2);
imageline($image, 55, 0, 34, 60, $colour3);


imagepng($image);

imagedestroy($image);
?>
Can anyone please explain the problem.
It can be seen online at
http://www.rna-carmarthen.org.uk/testcaptcha/start.html
http://www.rna-carmarthen.org.uk/testcaptcha/captcha.php
Thanks in advance
Teriel9
 
T

Teriel9

Thank you again, my apologies for being so obtuse.
Teriel9

--
All our emails are scanned by Norton Antivirus before sending
Please advise any virus that gets through
SingaporeWebDesign said:
Hello,

From the link I specified
"Since PHP 4.3 there is a bundled version of the GD lib. This bundled
version has some additional features like alpha blending, and should be
used in preference to the external library since its codebase is better
maintained and more stable. "

For installation in windows, from the link I specified:
"In Windows, you'll include the GD2 DLL php_gd2.dll as an extension in
php.ini. "

--
Singapore Website Design
http://www.bootstrike.com/Webdesign/
Singapore Web Hosting
http://www.bootstrike.com/WinXP/faq.html
Windows XP FAQ

Teriel9 said:
Hi,
My ISP has asked if this GDI module requires a specific version of PHP,
can you help please.
They are using a Windows server
They have also offered to transfer to a UNIX server, which they say suits
.php better, my only worry is whether my "Contentseed" application will
still function OK.
Thanks in advance
Teriel9


--
All our emails are scanned by Norton Antivirus before sending
Please advise any virus that gets through
SingaporeWebDesign said:
Hello,

That error is caused because gdi library module is not enabled in PHP.
You will need to contact your hosting company to enable them.

http://sg2.php.net/gd

--
Singapore Website Design
http://www.bootstrike.com/Webdesign/
Singapore Web Hosting
http://www.bootstrike.com/WinXP/faq.html
Windows XP FAQ

I am trying to test my server fpr PHP function for use in a CAPTCHA and
I get this message if I open the CAPTCHA generating page

<br />
<b>Fatal error</b>: Call to undefined function: imagecreate() in
<b>c:\home\rnacarms\html\testcaptcha\captcha.php</b> on line
<b>6</b><br />This is the code on the captcha.php
page<?phpsession_start();
header("Content-type: image/png");

$image = imagecreate(60,20);

$background_color = ImageColorAllocate($image, rand(64,70),
rand(70,73), rand(100,110));

$colour1 = ImageColorAllocate($image, rand(121,255), rand(126,255),
rand(197,255));
$colour2 = ImageColorAllocate($image, rand(100,255), rand(120,255),
rand(105,255));
$colour3 = ImageColorAllocate($image, rand(131,255), rand(137,255),
rand(100,255));


imagestring($image,5,8,2,$_SESSION["captcha"],$colour1);
imagestring($image,5,8,2,$_SESSION["captcha"],$colour2);
imagestring($image,5,8,2,$_SESSION["captcha"],$colour3);


imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour1);
imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour2);
imageline($image, rand(1,300), rand(1,3), rand(10,150), rand(0,150),
$colour3);


imageline($image, 10, 0, 14, 10, $colour1);
imageline($image, 20, 0, 24, 30, $colour2);
imageline($image, 55, 0, 34, 60, $colour3);


imagepng($image);

imagedestroy($image);
?>
Can anyone please explain the problem.
It can be seen online at
http://www.rna-carmarthen.org.uk/testcaptcha/start.html
http://www.rna-carmarthen.org.uk/testcaptcha/captcha.php
Thanks in advance
Teriel9
 
Top