10/10/2018, 09:48 
               
            Hỏi về host resell
               
					Hiện mình đang có một host resell và vướng mắc phải các lỗi sau mong mọi người giúp.
+Tạo ảnh ramdom để anti spam không hiển thị dc và có dòng lỗi
	Mình nghĩ có lẽ là do không mở chức năng extension=php_gd2.dll trong php.ini.
Ai biết thì chỉ giùm mình cách mở chức năng tạo ảnh này nhé .
            
         +Tạo ảnh ramdom để anti spam không hiển thị dc và có dòng lỗi
Code:
	Fatal error: Call to undefined function imagecreate() in /home/clbmuvn/public_html/create_image.php on line 12
Ai biết thì chỉ giùm mình cách mở chức năng tạo ảnh này nhé .
            Bài liên quan
         
               
            




<?php session_start(); create_image(); exit(); function create_image() { $md5_hash = md5(rand(0,999)); $security_code = substr($md5_hash, 15, 5); $_SESSION["security_code"] = md5($security_code); $width = 73; $height = 20; $image = ImageCreate($width, $height); $white = ImageColorAllocate($image, 14, 59, 130); $black = ImageColorAllocate($image, 240, 254, 255); ImageFill($image, 0, 0, $black); ImageString($image, 5, 15, 2, $security_code, $white); header("Content-Type: image/jpeg"); ImageJpeg($image); ImageDestroy($image); } ?>mình tạo ra trên máy mình ok mà bạn .
[=========> Bổ sung bài viết <=========]
Dùng cả cái này cũng ko được
<?php session_start(); // generate 5 digit random number $rand = rand(10000, 99999); // create the hash for the random number and put it in the session $_SESSION['image_random_value'] = md5($rand); // create the image $image = imagecreate(50, 18); // use white as the background image $bgColor = imagecolorallocate ($image, 0x88, 0x00, 0x00); // the text color is black $textColor = imagecolorallocate ($image, 0xCC, 0XCC, 0xCC); // write the random number imagestring ($image, 4, 3, 1, $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); ?>