在linux图片上传不了 验证码不能显示 原程序是在xp iis 下做的 传到测试服务器上是 win2003 iis 下没有问题现在换到linux Apache 下上传图片 就上传不了 验证码也不显示了因为我是个半吊子 实在不知道原因 各位大大知道的给我说一下谢谢啊!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 php跨平台的那你贴代码看看…这样子也说不出什么…,显示验证码的部分 <?php session_start(); // generate 5 digit random number $rand = rand(1000, 9999); // create the hash for the random number and put it in the session $_SESSION['image_random_value'] = md5($rand); // create the image(width,height) $image = imagecreate(45, 22); // use white as the background image $bgColor = imagecolorallocate ($image, 255, 255, 255); // the text color is black $textColor = imagecolorallocate ($image, 0, 0, 0); // write the random number imagestring ($image, 5, 5, 3, $rand, $textColor); // send several headers to make sure the image is not cached // taken directly from the PHP Manual // Date in the past header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // always modified header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // HTTP/1.1 header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); // HTTP/1.0 header("Pragma: no-cache"); // send the content type header so the image is displayed properly header('Content-type: image/jpeg'); // send the image to the browser imagejpeg($image); // destroy the image to free up the memory imagedestroy($image);?>这个是生成验证码部分的代码<img src="common/gif.php">这个是调用 这个文件的地方的代码 http://www.cooperelate.com/现在验证码被注释掉了。 http://www.cooperelate.com/common/gif.php //这个文件也没了啊……看不到状况 http://www.cooperelate.com/bg/common/gif.php Call to undefined function imagecreate()……imagecreate没定义,GD库不支持吧? 自己看看吧Fatal error: Call to undefined function imagecreate() in /usr/local/apache2/htdocs/bg/common/gif.php on line 11这是你的错误 嗯 我先让服务器那边解决这个问题如果还有问题的话我会在这个帖子 我会给帖子加分的 谢谢 amani11 和 kyzy_yy_pm 的帮忙 想不明白的PHP正则问题 <script>为何不会弹出Confirm对话框 递归调用自定义函数出现内存使用的问题 求一思路,js与PHP配合完成XMLHTTP操作 打个比方描述一下CMS跟一个网站的关系. 看到php文件中有这么一条语句: 程序写的时候,应该采用哪种方法,第1种还是第2种 初学PHP....装在IIS 但显示不了....求助~~~ ftp 功能 ??? php中图形存储到数据库中有那些解决方案 PHP执行Linux命令exec的问题 mysql可以执行的存储过程,php调用后获取不到结果
session_start();
// generate 5 digit random number
$rand = rand(1000, 9999);
// create the hash for the random number and put it in the session
$_SESSION['image_random_value'] = md5($rand);
// create the image(width,height)
$image = imagecreate(45, 22);
// use white as the background image
$bgColor = imagecolorallocate ($image, 255, 255, 255);
// the text color is black
$textColor = imagecolorallocate ($image, 0, 0, 0);
// write the random number
imagestring ($image, 5, 5, 3, $rand, $textColor);
// send several headers to make sure the image is not cached
// taken directly from the PHP Manual
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
// send the content type header so the image is displayed properly
header('Content-type: image/jpeg');
// send the image to the browser
imagejpeg($image);
// destroy the image to free up the memory
imagedestroy($image);
?>这个是生成验证码部分的代码
<img src="common/gif.php">
这个是调用 这个文件的地方的代码
现在验证码被注释掉了。
imagecreate没定义,GD库不支持吧?
如果还有问题的话我会在这个帖子 我会给帖子加分的 谢谢 amani11 和 kyzy_yy_pm 的帮忙