imagepng没有显示应该显示的内容

时间:2016-02-19 14:41:48

标签: php mysqli

所以我正在制作签名系统,昨晚它工作,它显示图像,但我去睡觉,关闭我的电脑,当我回来时我发现它已经停止工作,它开始显示这个图片,昨晚显示但我以某种方式工作,我不知道如何诚实。

这就是我得到的:

  

当我尝试获取图片时:http://i.imgur.com/A96dYZp.jpg   PHPINFO:http://i.imgur.com/AjFJ3VF.jpg

CODE:

<?php

if (file_exists(dirname(__FILE__) . '/SSI.php')) {
require(dirname(__FILE__) . '/SSI.php');
}
else die("GRESKA: SSI.php nije pronaden!");


error_reporting(E_ALL);
$username="root"; // KORSINICKO IME
$password=""; // ŠIFRA
$database="smf"; // BAZA
$host="localhost"; // HOST

$con = mysqli_connect($host,$username,$password,$database) or die( "GRESKA: Dogodila se greska pri povezivanju na bazu podataka!");

if(isset($_GET['id'])) $korisnikov_id = $_GET['id']; // DOBAVLJA KORISNIKOV ID
else if(isset($_POST['id'])) $korisnikov_id = $_POST['id'];

$korisnikov_id = mysqli_real_escape_string($con, $korisnikov_id); 

if(isset($_GET['stil'])) $stil = $_GET['stil']; // DOBAVLJA STIL POTPISA
else if(isset($_POST['stil'])) $stil = $_POST['stil'];

$stil = mysqli_real_escape_string($con, $stil);

if($stil == 1 ) // STIL I
{ 

$query = "SELECT * FROM `smf_members` WHERE `id_member` = '$korisnikov_id' LIMIT 1"; // VADI PODATKE IZ KOJE TABELE?

$rezultat = mysqli_query($con, $query) or die(mysqli_error());

if(mysqli_num_rows($rezultat) == "0") die("GRESKA: Taj korisnicki ID ne postoji u bazi."); // ID JE 0 ILI JOS NIJE REGISTROVAN???

$row = mysqli_fetch_assoc($rezultat);

$ime = $row['real_name']; // KORISNIKOVO TRENUTNO IME
$postovi = $row['posts']; // POSTOVI
$grupe = $row['id_group']; // GRUPA  
$spol = $row['gender']; // SPOL
$email = $row['email_address']; // KORISNIKOV EMAIL
$vreme = $row['total_time_logged_in']; // VREME PROVEDENO NA FORUMU

    // KONVERTER VREMENA
    function secondsToWords($vreme)
    {
        $days=(int)($vreme/86400);
        $hours = (int)(($vreme-($days*86400))/3600);
        $mins = (int)(($vreme-$days*86400-$hours*3600)/60);
        return sprintf("%dd %dh %dm", $days, $hours, $mins);
    }

if($spol == 1) $spoltext = "Musko";
if($spol == 2) $spoltext = "Zensko";
if($spol == 0) $spoltext = "Nepoznato";

// DOBAVLJAMO STVARI DIREKTNO SA PROFILA

global $context, $settings, $modSettings, $db_prefix, $boardurl;

 loadMemberData(array($korisnikov_id), false, 'profile');
 loadMemberContext($korisnikov_id);

  $context['status'] = $memberContext[$korisnikov_id]['online']['text']; // ONLINE/OFFLINE STATUS
  $context['avatar'] = $memberContext[$korisnikov_id]['avatar']['href']; // AVATAR

header("Content-type: image/jpeg,image/gif,image/png"); // PRETVARA STRANICU U SLIKU

$Potpisi = @imagecreatefrompng("cover_1.png"); // LOKACIJA SLIKE

$BOJA_BELA = imagecolorallocate($Potpisi, 255, 255, 255);
$BOJA_CRVENA = imagecolorallocate($Potpisi, 255, 0, 0);
$BOJA_PURPLE = imagecolorallocate($Potpisi, 128,0,128);

$FONT = "./Fontovi/BebasNeue.otf"; // FONT

$ADMINISTRATOR = 'Administrator'; // RANKOVI
$SMOD = 'Super Moderator'; // RANKOVI
$CLAN = 'Clan';

if($grupe == 1) // GRUPE
{
    imagettftext($Potpisi, 21, 0, 115, 50, $BOJA_BELA, $FONT, $ime); // VELIKO IME
    imagettftext($Potpisi, 17, 0, 115, 90, $BOJA_CRVENA, $FONT, $ADMINISTRATOR); // ADMINISTRATOR
}
else if($grupe == 2) // GRUPE
{
    imagettftext($Potpisi, 21, 0, 115, 50, $BOJA_BELA, $FONT, $ime); // VELIKO IME
    imagettftext($Potpisi, 17, 0, 115, 90, $BOJA_PURPLE, $FONT, $SMOD); // ADMINISTRATOR
}
else
{
    imagettftext($Potpisi, 21, 0, 115, 50, $BOJA_BELA, $FONT, $ime); // VELIKO IME
    imagettftext($Potpisi, 17, 0, 115, 90, $BOJA_BELA, $FONT, $CLAN); // CLAN
}

imagettftext($Potpisi, 13, 0, 75, 194, $BOJA_BELA, $FONT, $postovi); // POSTOVI
imagettftext($Potpisi, 13, 0, 210, 194, $BOJA_BELA, $FONT, secondsToWords($vreme)); // VREME PROVEDENO ONLINE
imagettftext($Potpisi, 13, 0, 354, 194, $BOJA_BELA, $FONT, $spoltext); // SPOL
imagettftext($Potpisi, 17, 0, 115, 70, $BOJA_BELA, $FONT, $email); // EMAIL
imagettftext($Potpisi, 17, 0, 115, 110, $BOJA_BELA, $FONT, $context['status']); // ONLINE/OFFLINE INDIKATOR

// DOBAVLJAČ AVATARA SA PROFILA KORISNIKA TE KONVERTER SLIKE
if (exif_imagetype($context['avatar']) == IMAGETYPE_GIF)
$traziavatar = imagecreatefromgif($context['avatar']);

if (exif_imagetype($context['avatar']) == IMAGETYPE_PNG)
    $traziavatar = imagecreatefrompng($context['avatar']);

if (exif_imagetype($context['avatar']) == IMAGETYPE_JPEG)
    $traziavatar = imagecreatefromjpeg($context['avatar']);

list($width, $height) = getimagesize($context['avatar']); // KONVERTOVANJE AVATARA

$context['avatar'] = imagecreatetruecolor(512, 512);
imagecopyresampled($Potpisi, $traziavatar, 16.5, 25, 0, 0, 92, 92, $width, $height);  // PRIKAZ AVATARA

ImagePng($Potpisi);
ImageDestroy($Potpisi);

}
else 
{ 
    die("GRESKA: Taj stil ne postoji u bazi podataka! Pronadjeni stilovi (1) , (2)"); 
}

?>

我的日志包含以下内容:

[Fri Feb 19 15:52:12.629932 2016] [ssl:warn] [pid 5848:tid 248] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Feb 19 15:52:12.699932 2016] [core:warn] [pid 5848:tid 248] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Fri Feb 19 15:52:12.859932 2016] [ssl:warn] [pid 5848:tid 248] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Feb 19 15:52:12.899932 2016] [mpm_winnt:notice] [pid 5848:tid 248] AH00455: Apache/2.4.17 (Win32) OpenSSL/1.0.2d PHP/5.6.15 configured -- resuming normal operations
[Fri Feb 19 15:52:12.899932 2016] [mpm_winnt:notice] [pid 5848:tid 248] AH00456: Apache Lounge VC11 Server built: Oct 13 2015 10:54:13
[Fri Feb 19 15:52:12.899932 2016] [core:notice] [pid 5848:tid 248] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Fri Feb 19 15:52:12.909932 2016] [mpm_winnt:notice] [pid 5848:tid 248] AH00418: Parent: Created child process 2576
[Fri Feb 19 15:52:13.449940 2016] [ssl:warn] [pid 2576:tid 260] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Feb 19 15:52:13.791941 2016] [ssl:warn] [pid 2576:tid 260] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Feb 19 15:52:13.831941 2016] [mpm_winnt:notice] [pid 2576:tid 260] AH00354: Child: Starting 150 worker threads.

0 个答案:

没有答案