0
我最喜歡的網站和第一次寫作在這裏。我已經寫了一個圖像使用php這項工作很好在我的本地主機,但它不是在互聯網上(000webhost)ogortking我GOOGLE了,然後檢查我的Gd庫上,我也設置了權限,但仍然沒有顯示圖像。圖形不在互聯網上顯示,但在本地主機上很好(php)
<?php
session_start();
// File and new size
$filename = 'images/solar-kid.jpg';
if(isset($_POST['sub']))
{
$txt=$_POST['txt'];
}
// Content type
header('Content-Type:image/jpeg');
// Get new sizes
list($width, $height) = getimagesize($filename);
$newwidth = 350;
$newheight = 300;
// Load
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);
// Resize
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
$white = imagecolorallocate($thumb, 255, 255, 255);
$grey = imagecolorallocate($thumb, 128, 128, 128);
$black = imagecolorallocate($thumb, 0, 0, 0);
imagefilledrectangle($thumb, 0, 0, 399, 29, $black);
imagefilledrectangle($thumb, 0, 270, 399, 299, $black);
$white = imagecolorallocate($thumb, 255, 255, 255);
$black = imagecolorallocate($thumb, 0, 0, 0);
$text = $txt;
$font = 'times.ttf';
imagettftext($thumb, 15, 0, 10, 20, $white, $font, $text);
// Output
imagejpeg($thumb);
?>
這裏是它顯示的網站Click here