gpt4 book ai didi

php - undefined offset PHP,不确定它的作用

转载 作者:可可西里 更新时间:2023-11-01 00:12:28 27 4
gpt4 key购买 nike

<分区>

我在 PHP error.log 中有以下错误

[Tue Dec 19 12:08:22.887574 2017] [:error] [pid 32196] [client xx.xx.xx.x:20560] PHP Notice: Undefined offset: 8 in /var/www/html/page.php on line 55, referer: view.php?1x=8

我认为造成这种情况的 php 代码是:

$i = isset($_SESSION['i']) ? $_SESSION['i'] : 0;
// echo $_SESSION['websites'][$i];
$website = explode(";", $_SESSION['websites'][$i]);
// echo $website[0];
$i++;
$_SESSION['i'] = $i;

我真的不知道 $i = isset($_SESSION['i']) 是什么? $_SESSION['i'] : 0;

谢谢

session_start();
$i = isset($_SESSION['i']) ? $_SESSION['i'] : 0;
if ($_SESSION['i'] < $sesioni1x) {
// echo $_SESSION['websites'][$i];
$website = explode(";", $_SESSION['websites'][$i]);
// echo $website[0];
$i++;
$_SESSION['i'] = $i;
header("Location: $website[0]"); //redirect
die();
// echo $website[0];
// echo $sesioni1x;
// echo $website[0]." Frame-URL<br>";
// $_SESSION['actual_website'] = $website[0];
}
if ($_SESSION['i'] == $sesioni1x) {
$handle = fopen($list1x, "a"); //open file to append content to csv file
fputcsv($handle, $_SESSION['addwebsite'], ";"); //insert line in opened file
fclose($handle); //close file
header("Location: index.php"); //redirect
die();
// echo "session = var";
}

这是我得到这个警告的完整代码,我必须说脚本正在做他的工作,但我想摆脱这个错误

源码中的$_SESSION['i']为0

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com