看板 PHP 關於我們 聯絡資訊
html: <img src="captcha.php" id="captcha" alt="captcha" /> php: <?session_start();?> <?php create_image(); exit(); function create_image(){ $security_code =$_SESSION["security_code"]; $image = @imagecreatefromjpeg("images\static.jpg"); $black = ImageColorAllocate($image, 0, 0, 0); $vPos = 4; $hPos = 30; $fontSize = 5; ImageString($image, $fontSize, $hPos, $vPos, $security_code, $black); header("Content-Type: image/jpeg"); ImageJpeg($image); ImageDestroy($image); } ?> 想請問為什麼一直跑不出圖片呢@@ php所要引用的圖片也有放對位置 懇求幫忙解答... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.163.194.235
chrisckroot:GD有安裝麼? 08/23 15:59
jackyeah1213:有 有安裝 08/23 16:06
arrack:先註解掉 header("Content-Type: image/jpeg"); 08/23 17:52
arrack:然後拿掉@,看看有沒有錯誤產生 08/23 17:52
kerash:為什麼要特別寫一個funtion再呼叫?另外<?改成<?php 08/23 20:28
TeemingVoid:應該是: "images\static.jpg" 路徑要用 / 斜線啦! ^^ 08/23 21:06