Home > Backend Development > PHP Tutorial > php-关于PHP cookies,网页无法结果

php-关于PHP cookies,网页无法结果

WBOY
Release: 2016-06-02 11:31:32
Original
923 people have browsed it

php

最近我在学习PHPcookies碰到如下问题:
我写了两段简单的代码:
c.php

session_start();
$sid=SID;

$_session['user']='xu';
$_session['password']='123';
echo'登录 a>';
?>
d.php
session_start();
if($_SESSION['user']=='xu'&&$_SESSION['password']=='123')
echo "欢迎{$_SESSION['user']}回来";
else
echo "bye";
?>
我在浏览器中已经设置允许cookies,但是网页显示出来还是这个问题:
Notice: Undefined index: user in D:\Download\PHP\xmapp\htdocs\php12\d.php on line 3
bye
我很迷茫,希望高手能给点提示

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template