כן רשמתי כבר שניסיתי ככה
הדף gd.php:
PHP קוד:
<?php
session_start();
header ("Content-type: image/png");
$filename = 're.png';
$im = imagecreatefrompng($filename);
$RandSec = strtoupper(substr(md5(rand(1,999999)),0,6)); //Making the 6 Characters Security Code , using MD5 And Rand()
$_SESSION['icode'] = $RandSec;
$textcolor = imagecolorallocate($im,0,0,0); //White
imagestring($im, 6,10,4, $RandSec,$textcolor);
imagepng($im);
?>
ובאינדקס:
PHP קוד:
<?
echo "<IMG SRC="gd.php" name=secimg>";
echo "test";
?>
ככה זה
עובד! אבל... אני צריך לעשות התאמה בין הסיישן שנשמר בדף gd.php לבין התמונה שאני מציג באינדקס.
אבל בשביל זה אני צריך לעשות require לדף GD.PHP ואם אני עושה את זה אז זה מציג רק את התמונה בלי מה שאמור להיות מתחת לזה.
הנה דוגמא פה:
http://elad.fire-serv.net/gd/elad.php
תראו את האי התאמה בין התמונה לסיישן.