Pisanje po slici

Kako da stavim text na neku sliku?

Ja sam stavio

	header('Content-Type: image/png;'); 
	$image = imagecreatefrompng('Signature_1.png');
	$text_color = imagecolorallocate($image, 223, 0, 0);
	$font = 'trebaucit.ttf';
	imagettftext($image, 16.5, 0, 85, 57, $text_color, $font, "Test");
	imagepng($image);;
	imagedestroy($image);

I pise mi

The image “http://localhost/potpisi/izradapotisa.php” cannot be displayed because it contains errors

Kako da to rijesim?

Koji ti editor koristis pa ti ne prijavljuje greške koje praviš???

6 linija -> imaš dva karaktera “tačka-zarez”.

Opet ista greska

The image “http://localhost/potpisi/izradapotisa.php” cannot be displayed because it contains errors

Kod mene taj isti kod prođe. Dakle nije ti greška u tom dijelu koda…vjerovatno imaš problem negdje drugo u kodu.

Provjeri jesi li dobro upisao ime fonta i je li na točnoj lokaciji.

komentiraj ovaj header i vidi sto pise, kojie error

Hoces da ti danem PHP fajl pa ti to uradi ja neznam :smiley:

Evo taj PHP fajl

<?php
include("funkcije.php");

$ftphost = "/////";
$ftpuser = "/////";
$ftppass = "/////";
$ftpcon	= ftp_connect($ftphost,21) or die("Ne mogu se konektovati na $ftphost, kontaktiraj webmastera.");
$login = ftp_login($ftpcon,$ftpuser,$ftppass);
$usersdir = "/public_html/Signatures system/igraci";
$ime = $_POST['username'];
if(ftp_size($ftpcon,"$usersdir/$ime.ini") == -1)
{
     echo "Trazena signatura ne postoji! Moguci razlozi:

";echo "1. Signatura za trazeni racun nije aktivirana u igri!
";echo "2. Unijeli ste pogresan nick (foramt Ime_Prezime)!
";echo "3. Trazeni korisnicki racun jednostavno ne postoji!
";
}
else
{
      	ftp_pasv($ftpcon,true);
	$fhandle = fopen("tempsign_".hash('sha256',"$ime").".tmp","w+");
	ftp_fget($ftpcon,$fhandle,"$usersdir/$ime.ini",FTP_ASCII);
	$str = parse_ini_file2("tempsign_".hash('sha256',"$ime").".tmp");
	fclose($fhandle);
        /*echo ("Server infornacije:") . '<table><colgroup width=200 span=2></colgroup><tr><td>';
	if($str['Skin']) echo '<img src="slike/skins/Skin_'.$str['Skin'].'.png">';
	else echo '<img src="slike/skins/Skin_'.$str['Skin'].'.png">';
        echo "
Ime na serveru: $ime
";
        echo "Level: ".$str['Level']."
";
        echo "EMail: ".$str['EMail']."
";
        echo "Novac: ".$str['Novac']."
";
        echo "GameSage: ".$str['GameSage']."
";
        echo "Admin: ".$str['Admin']."
";
        echo "Skin: ".$str['Skin']."
";
        echo "Zadnji login: ".$str['ZadnjiPutOnline']."
";*/

}
ftp_close($ftpcon);
	unset($str);
	unset($ftphost);
	unset($ftpuser);
	unset($ftppass);
	unset($ftpcon);
	unset($login);
?>	
<title>RG signature system</title>	
$font = 'trebaucit.ttf';

U fontu ti je problem, ja probao.

Meni ovo ispise

Warning: imagecreatefrompng(./signs/Boris_Cubra.png) [function.imagecreatefrompng]: failed to open stream: No such file or directory in /home/a2165316/public_html/Signatures system/izradapotpisa.php on line 22

PHP Error Message

Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /home/a2165316/public_html/Signatures system/izradapotpisa.php on line 23

PHP Error Message

Warning: imagettftext() expects parameter 1 to be resource, boolean given in /home/a2165316/public_html/Signatures system/izradapotpisa.php on line 30

To je na webhostu

Boris Cubra :smiley:

NICK: Boris_Cubra

moraš staviti full path do slike ili ta slika uopće ne postoji

Kako da to stavim?

prvo saznaj što je full path, za to koristi gugl!

Rijesio sam za sliku kako da napravim da update podatke?

LOCK rjeseno!


Copyright © 2022 WM Forum - AboutContact