首页 > php教程 > PHP源码 > session_start() [function.session-start]:

session_start() [function.session-start]:

WBOY
发布: 2016-06-08 17:28:31
原创
1281 人浏览过
<script>ec(2);</script>

我在学习PHP的,当我尝试做在session_start() - 获取有关错误信息不能发送会话cookie。

我看到在这个问题上前面的问题,但是,仍然不能确定我的错误。

如果是错误家伙?
session_start();
      if ($_POST['add'])
      {
            foreach ($_POST['a_qty'] as $k => $v)
            {
                  $_SESSION['cart'][$k] = $_SESSION['cart'][$k] + $v;
            }
      }
?>
// look for catalog file
      $catalogfile = "catalog.dat";
      // file is avaialbe, extract data from it and place into $catalog, with sku as key
      if (file_exists($catalogfile))
      {
            $data = file($catalogfile);
            foreach ($data as $line)
            {
                  $lineArray = explode(":", $line);
                  $sku = trim($lineArray[0]);
                  $CATALOG[$sku]['desc'] = trim($lineArray[1]);
                  $CATALOG[$sku]['price'] = trim($lineArray[2]);                             
            }
      }
      else
      {
            die("Could not find the catalog file");
      }
?>


            // print items from the catalog for selection
            foreach ($CATALOG as $k => $v)
            {
                  echo "";
                  echo " ";
            }
?>
";
                  echo "" . $v['desc'] . "";
                  echo "
";
                  echo "Price per unit: " . $CATALOG[$k]['price'];
                  echo "
Quantity: ";
                  echo "";
                  echo "
相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门推荐
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板