我的index.php文件我已经somethingk,如:与PHP的问题导致图像
<?php
session_start();
$_SESSION[some_value] = 1;
?>
<img src="image.php" alt="some image"/>
<?php
$_SESSION[some_value] = 0;
?>
我image.php文件我有看起来像(基本代码):
<?php
session_start();
header("Content-Type: image/png");
$im = @imagecreate(400, 20)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 255, 255, 255);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5,"session value is : {$_SESSION[some_value]}", $text_color);
imagepng($im);
imagedestroy($im);
?>
现在,当我加载我的index.php页面在浏览器中的图像中的值是session value is : 0
,如何使它显示1,然后在index.php
代码将其设置为0(将image.php
代码添加到设置值为0是不是我要找的)