本文目錄一覽:
phpstudy前台驗證碼無法顯示
你這個問題出現在前台的代碼裡面,你找到顯示這個頁面的源文件,打開源文件刪除這個驗證碼的代碼就可以了。
有個更好的辦法找到,使用F12點擊右上方的那個按鈕,就能找到這個位置了,可以右鍵查看源代碼,也可以
phpwind無法顯示驗證碼,請教高手怎麼回事
首先要確定問題是不是因為網速引起的,刷新一下頁面,或者網速好的時候再試一下。如果是本地的服務器,那就排除網速的問題,你可以使用phpinfo()函數查看是否開啟了GD庫的支持,沒有開的話。找到php安裝目錄,找到php.ini文件,將php_gd2.dll前的分號(;)去掉重啟apache即可。如果還是不行,那就要考慮代碼問題了,是否改動代碼了,或者代碼的使用方法不對
php中文驗證碼無法顯示
session_start();
$image=imagecreatetruecolor(200, 60);//創建畫布
$color = imagecolorallocate($image, mt_rand(157,255), mt_rand(157,255), mt_rand(157,255));//隨機顏色
//$color=imagecolorallocate($image, 255, 255, 255);
imagefill($image, 0, 0, $color);//填充顏色
//中文驗證碼
$fontface=”simhei.ttf”;//確保相同目錄下有該字體
$strdb=array(‘好’,’多’,’人’,’在’,’學’,’習’);
for ($i=0;$i4;$i++){
$fontsizecolor=imagecolorallocate($image, mt_rand(0, 150), mt_rand(0, 150), mt_rand(0, 150));
$codex=iconv(“GB2312″,”UTF-8”,$strdb[mt_rand(0,5)]);//iconv不能轉數組 取任意下標
imagettftext($image, mt_rand(20, 24), mt_rand(-30, 30), (40*$i+20), mt_rand(30, 35), $fontsizecolor, $fontface, $codex);//如果用$code的話 就生成 1+2+3+4 是個漢字的驗證碼了
}
//干擾點
for ($i=0;$i200;$i++){
$pointcolor=imagecolorallocate($image, mt_rand(50, 200), mt_rand(50, 200), mt_rand(50, 200));
imagesetpixel($image, mt_rand(1, 100), mt_rand(1,20), $pointcolor); //雪花
}
//干擾線
for ($i=0;$i3;$i++){
$linecolor=imagecolorallocate($image, mt_rand(50, 200), mt_rand(50, 200), mt_rand(50, 200));
imageline($image, mt_rand(1, 99), mt_rand(1, 99), mt_rand(1, 99), mt_rand(1, 99), $linecolor);
}
ob_clean();
header(“Content-type:image/png”);
imagepng($image);
imagedestroy($image);
為什麼apache php無法顯示驗證碼
驗證碼一般需要安裝GD庫來支持的,你可以看一下你的php.ini文件中是否開啟了這一項,如果開啟後重啟Apache報錯,那麼還需要你安裝。
Windows中是一個.dll文件,放到相應的目錄就可以了。
Linux下安裝可能對PHP的版本之類的有要求,最好別安裝最新版本的GD庫。
php網站驗證碼不顯示
我有一種方法給樓主:
用IE瀏覽器,右鍵,屬性,看看路徑有沒有問題。
你的服務器系統有變化嗎?
如果你之前使用的是windows現在是Linux的話,可能是大小寫的問題。
希望能幫到你
原創文章,作者:JHBG,如若轉載,請註明出處:https://www.506064.com/zh-hant/n/140466.html