שלום,
רציתי לדעת למה אי אפשר להדפיס כלום אחרי הפלט של התמונה?
זה הקוד:
ככה אני שולף:
PHP קוד:
require('gd.php');
session_start();
$x = $image->gd();
echo "<img src=gd.php?$x>" ;
echo "{$_SESSION['icode']}";
וזה הדף gd.php :
PHP קוד:
session_start();
$image = new SecurityImage;
class SecurityImage
{
function gd()
{
global $image;
header ("Content-type: image/png");
$this->iName = $filename = 're.png';
$this->iCreate = $im = imagecreatefrompng($filename);
$this->iCreateCode = $RandSec = strtoupper(substr(md5(rand(1,999999)),0,6)); //Making the 6 Characters Security Code , using MD5 And Rand()
$_SESSION['icode'] = $RandSec;
$this->iColor = $textcolor = imagecolorallocate($im,0,0,0); //White
$this->iImgString = imagestring($im, 6,10,4, $RandSec,$textcolor);
$this->iGetCode = imagepng($im);
}
}
תודה.