Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP验证码图像未在chrome中显示_Php_Captcha - Fatal编程技术网

PHP验证码图像未在chrome中显示

PHP验证码图像未在chrome中显示,php,captcha,Php,Captcha,我使用PHP创建验证码图像。它在加载时显示验证码。完成加载后,它不会在Chrome中显示验证码图像。在其他浏览器中,它工作正常。为什么? <?php // Create an image from button.png $image = imagecreatefrompng('button.png'); // Set the font colour $colour = imagecolorallocate($image, 255, 120, 4); // Set the font $f

我使用PHP创建验证码图像。它在加载时显示验证码。完成加载后,它不会在Chrome中显示验证码图像。在其他浏览器中,它工作正常。为什么?

<?php
// Create an image from button.png
$image = imagecreatefrompng('button.png');

// Set the font colour
$colour = imagecolorallocate($image, 255, 120, 4);

// Set the font
$font = '../fonts/Anorexia.ttf';

// Set a random integer for the rotation between -15 and 15 degrees
$rotate = rand(-15, 15);

// Create an image using our original image and adding the detail
imagettftext($image, 18, $rotate, 18, 30, $colour, $font, $str);

// Output the image as a png
imagepng($image);

?>

有同样的问题。。 一个可能的原因是反横幅/防病毒。。 我在用卡巴斯基。。当我关掉卡巴斯基验证码显示ok时, 铬有点奇怪。。我认为他们应该寻找这个有同样问题的问题。。 一个可能的原因是反横幅/防病毒。。 我在用卡巴斯基。。当我关掉卡巴斯基验证码显示ok时,
铬有点奇怪。。我认为他们应该查找这个问题

您的整个代码都是正确的,只需包括

header('Content-Type:image/png')


在您的代码上方…

您的整个代码都是正确的,只需包括

header('Content-Type:image/png')


在您的代码上方…

谢谢。。我已经像你说的那样关掉了卡巴斯基。现在它开始工作了。这是什么原因?它有点奇怪的铬。据我所知,CAPTCHE是从PHP文件载入头,所以它被认为是一个外部的旗帜,这就是为什么它被封锁在Chrome。别忘了让我的答案正确:)完成:)好的,除了关闭卡巴斯基,还有其他方法显示验证码吗?可能没有(不确定),如果你在chrome上查看一些验证码插件示例站点,你会看到同样的问题。你可以试试谷歌验证码插件。这可能在chrome中起作用。谢谢。。我已经像你说的那样关掉了卡巴斯基。现在它开始工作了。这是什么原因?它有点奇怪的铬。据我所知,CAPTCHE是从PHP文件载入头,所以它被认为是一个外部的旗帜,这就是为什么它被封锁在Chrome。别忘了让我的答案正确:)完成:)好的,除了关闭卡巴斯基,还有其他方法显示验证码吗?可能没有(不确定),如果你在chrome上查看一些验证码插件示例站点,你会看到同样的问题。你可以试试谷歌验证码插件。这可能在chrome中起作用。我已经添加了代码..另请参阅我已经添加了代码..另请参阅