2014-01-26 162 views
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

回答

0

000webhost的免费域名是不支持我不`吨知道为什么结果。我上传到另一个主机付费服务器上,它的功能就像一个魅力

相关问题